Skip to content

Commit d035593

Browse files
committed
Update @RequestParam Javadoc and remove Portlet mentions
1 parent b472d19 commit d035593

File tree

9 files changed

+25
-24
lines changed

9 files changed

+25
-24
lines changed

spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@
2727
/**
2828
* Annotation which indicates that a method parameter should be bound to a web request header.
2929
*
30-
* <p>Supported for annotated handler methods in Servlet and Portlet environments.
30+
* <p>Supported for annotated handler methods in Spring MVC and Spring WebFlux.
3131
*
3232
* <p>If the method parameter is {@link java.util.Map Map&lt;String, String&gt;},
3333
* {@link org.springframework.util.MultiValueMap MultiValueMap&lt;String, String&gt;},

spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,7 +29,17 @@
2929
* Annotation which indicates that a method parameter should be bound to a web
3030
* request parameter.
3131
*
32-
* <p>Supported for annotated handler methods in Servlet and Portlet environments.
32+
* <p>Supported for annotated handler methods in Spring MVC and Spring WebFlux
33+
* as follows:
34+
* <ul>
35+
* <li>In Spring MVC, "request parameters" map to query parameters, form data,
36+
* and parts in multipart requests. This is because the Servlet API combines
37+
* query parameters and form data into a single map called "parameters", and
38+
* that includes automatic parsing of the request body.
39+
* <li>In Spring WebFlux, "request parameters" map to query parameters only.
40+
* To work with all 3, query, form data, and multipart data, you can use data
41+
* binding to a command object annotated with {@link ModelAttribute}.
42+
* </ul>
3343
*
3444
* <p>If the method parameter type is {@link Map} and a request parameter name
3545
* is specified, then the request parameter value is converted to a {@link Map}

spring-web/src/main/java/org/springframework/web/bind/support/DefaultSessionAttributeStore.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
/**
2424
* Default implementation of the {@link SessionAttributeStore} interface,
25-
* storing the attributes in the WebRequest session (i.e. HttpSession
26-
* or PortletSession).
25+
* storing the attributes in the WebRequest session (i.e. HttpSession).
2726
*
2827
* @author Juergen Hoeller
2928
* @since 2.5

spring-web/src/main/java/org/springframework/web/context/WebApplicationContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public interface WebApplicationContext extends ApplicationContext {
7979
String SERVLET_CONTEXT_BEAN_NAME = "servletContext";
8080

8181
/**
82-
* Name of the ServletContext/PortletContext init-params environment bean in the factory.
83-
* <p>Note: Possibly merged with ServletConfig/PortletConfig parameters.
82+
* Name of the ServletContext init-params environment bean in the factory.
83+
* <p>Note: Possibly merged with ServletConfig parameters.
8484
* ServletConfig parameters override ServletContext parameters of the same name.
8585
* @see javax.servlet.ServletContext#getInitParameterNames()
8686
* @see javax.servlet.ServletContext#getInitParameter(String)
@@ -90,7 +90,7 @@ public interface WebApplicationContext extends ApplicationContext {
9090
String CONTEXT_PARAMETERS_BEAN_NAME = "contextParameters";
9191

9292
/**
93-
* Name of the ServletContext/PortletContext attributes environment bean in the factory.
93+
* Name of the ServletContext attributes environment bean in the factory.
9494
* @see javax.servlet.ServletContext#getAttributeNames()
9595
* @see javax.servlet.ServletContext#getAttribute(String)
9696
*/

spring-web/src/main/java/org/springframework/web/context/request/FacesRequestAttributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ else if ("resource".equals(key)) {
191191
public String getSessionId() {
192192
Object session = getExternalContext().getSession(true);
193193
try {
194-
// Both HttpSession and PortletSession have a getId() method.
194+
// HttpSession has a getId() method.
195195
Method getIdMethod = session.getClass().getMethod("getId");
196196
return String.valueOf(ReflectionUtils.invokeMethod(getIdMethod, session));
197197
}

spring-web/src/main/java/org/springframework/web/context/request/RequestAttributes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface RequestAttributes {
4040
/**
4141
* Constant that indicates session scope.
4242
* <p>This preferably refers to a locally isolated session, if such
43-
* a distinction is available (for example, in a Portlet environment).
43+
* a distinction is available.
4444
* Else, it simply refers to the common session.
4545
*/
4646
int SCOPE_SESSION = 1;
@@ -120,8 +120,8 @@ public interface RequestAttributes {
120120

121121
/**
122122
* Resolve the contextual reference for the given key, if any.
123-
* <p>At a minimum: the HttpServletRequest/PortletRequest reference for key
124-
* "request", and the HttpSession/PortletSession reference for key "session".
123+
* <p>At a minimum: the HttpServletRequest reference for key "request", and
124+
* the HttpSession reference for key "session".
125125
* @param key the contextual key
126126
* @return the corresponding object, or {@code null} if none found
127127
*/

spring-web/src/main/java/org/springframework/web/context/request/RequestContextHolder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public static RequestAttributes currentRequestAttributes() throws IllegalStateEx
132132
"Are you referring to request attributes outside of an actual web request, " +
133133
"or processing a request outside of the originally receiving thread? " +
134134
"If you are actually operating within a web request and still receive this message, " +
135-
"your code is probably running outside of DispatcherServlet/DispatcherPortlet: " +
135+
"your code is probably running outside of DispatcherServlet: " +
136136
"In this case, use RequestContextListener or RequestContextFilter to expose the current request.");
137137
}
138138
}

spring-web/src/main/java/org/springframework/web/context/request/WebRequestInterceptor.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
/**
2323
* Interface for general web request interception. Allows for being applied
24-
* to Servlet request as well as Portlet request environments, by building
25-
* on the {@link WebRequest} abstraction.
24+
* to Servlet request by building on the {@link WebRequest} abstraction.
2625
*
2726
* <p>This interface assumes MVC-style request processing: A handler gets executed,
2827
* exposes a set of model objects, then a view gets rendered based on that model.
@@ -40,13 +39,6 @@
4039
* <p>This interface is deliberately minimalistic to keep the dependencies of
4140
* generic request interceptors as minimal as feasible.
4241
*
43-
* <p><b>NOTE:</b> While this interceptor is applied to the entire request processing
44-
* in a Servlet environment, it is by default only applied to the <i>render</i> phase
45-
* in a Portlet environment, preparing and rendering a Portlet view. To apply
46-
* WebRequestInterceptors to the <i>action</i> phase as well, set the HandlerMapping's
47-
* "applyWebRequestInterceptorsToRenderPhaseOnly" flag to "false". Alternatively,
48-
* consider using the Portlet-specific HandlerInterceptor mechanism for such needs.
49-
*
5042
* @author Juergen Hoeller
5143
* @since 2.0
5244
* @see ServletWebRequest

spring-web/src/main/java/org/springframework/web/context/support/WebApplicationContextUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public static void registerEnvironmentBeans(ConfigurableListableBeanFactory bf,
215215
* with the given BeanFactory, as used by the WebApplicationContext.
216216
* @param bf the BeanFactory to configure
217217
* @param servletContext the ServletContext that we're running within
218-
* @param servletConfig the ServletConfig of the containing Portlet
218+
* @param servletConfig the ServletConfig
219219
*/
220220
public static void registerEnvironmentBeans(ConfigurableListableBeanFactory bf,
221221
@Nullable ServletContext servletContext, @Nullable ServletConfig servletConfig) {

0 commit comments

Comments
 (0)