WebRequest and HttpServletRequest in Spring MVC

What is the difference between the two? Both have a method getParameteras well as a method setAttribute, then where is the difference between the two?

1) Which one is better to use at all?

2) Please explain the specific scenarios in which they may be used.

+4
source share
1 answer

javadoc of WebRequest is pretty clear on this point:

Common interface for web request. It is mainly intended for general web request interceptors, giving them access to the metadata of the general request, and not for the actual processing of the request.

(a main attention).

javadoc WebRequestInterceptor, :

-. Servlet, Portlet, WebRequest.

, , WebRequest, WebRequestInterceptor. , , . , Spring MVC, HttpServletRequest.

+8

Source: https://habr.com/ru/post/1545483/


All Articles