Merge branch '5.3.x'
This commit is contained in:
@@ -1266,7 +1266,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
}
|
||||
|
||||
/**
|
||||
* No handler found -> set appropriate HTTP response status.
|
||||
* No handler found → set appropriate HTTP response status.
|
||||
* @param request current HTTP request
|
||||
* @param response current HTTP response
|
||||
* @throws Exception if preparing the response failed
|
||||
|
||||
@@ -303,7 +303,7 @@ public class ModelAndView {
|
||||
|
||||
/**
|
||||
* Add all attributes contained in the provided Map to the model.
|
||||
* @param modelMap a Map of attributeName -> attributeValue pairs
|
||||
* @param modelMap a Map of attributeName → attributeValue pairs
|
||||
* @see ModelMap#addAllAttributes(Map)
|
||||
* @see #getModelMap()
|
||||
*/
|
||||
|
||||
@@ -582,7 +582,7 @@ public abstract class RouterFunctions {
|
||||
* <pre class="code">
|
||||
* RouterFunction<ServerResponse> nestedRoute =
|
||||
* RouterFunctions.route()
|
||||
* .nest(RequestPredicates.path("/user"), () ->
|
||||
* .nest(RequestPredicates.path("/user"), () ->
|
||||
* RouterFunctions.route()
|
||||
* .GET(this::listUsers)
|
||||
* .POST(this::createUser)
|
||||
@@ -607,7 +607,7 @@ public abstract class RouterFunctions {
|
||||
* <pre class="code">
|
||||
* RouterFunction<ServerResponse> nestedRoute =
|
||||
* RouterFunctions.route()
|
||||
* .nest(RequestPredicates.path("/user"), builder ->
|
||||
* .nest(RequestPredicates.path("/user"), builder ->
|
||||
* builder.GET(this::listUsers)
|
||||
* .POST(this::createUser))
|
||||
* .build();
|
||||
@@ -652,7 +652,7 @@ public abstract class RouterFunctions {
|
||||
* <pre class="code">
|
||||
* RouterFunction<ServerResponse> nestedRoute =
|
||||
* RouterFunctions.route()
|
||||
* .path("/user", builder ->
|
||||
* .path("/user", builder ->
|
||||
* builder.GET(this::listUsers)
|
||||
* .POST(this::createUser))
|
||||
* .build();
|
||||
@@ -674,7 +674,7 @@ public abstract class RouterFunctions {
|
||||
* RouterFunction<ServerResponse> filteredRoute =
|
||||
* RouterFunctions.route()
|
||||
* .GET("/user", this::listUsers)
|
||||
* .filter((request, next) -> {
|
||||
* .filter((request, next) -> {
|
||||
* // check for authentication headers
|
||||
* if (isAuthenticated(request)) {
|
||||
* return next.handle(request);
|
||||
@@ -700,7 +700,7 @@ public abstract class RouterFunctions {
|
||||
* RouterFunction<ServerResponse> filteredRoute =
|
||||
* RouterFunctions.route()
|
||||
* .GET("/user", this::listUsers)
|
||||
* .before(request -> {
|
||||
* .before(request -> {
|
||||
* log(request);
|
||||
* return request;
|
||||
* })
|
||||
@@ -721,7 +721,7 @@ public abstract class RouterFunctions {
|
||||
* RouterFunction<ServerResponse> filteredRoute =
|
||||
* RouterFunctions.route()
|
||||
* .GET("/user", this::listUsers)
|
||||
* .after((request, response) -> {
|
||||
* .after((request, response) -> {
|
||||
* log(response);
|
||||
* return response;
|
||||
* })
|
||||
@@ -741,8 +741,8 @@ public abstract class RouterFunctions {
|
||||
* RouterFunction<ServerResponse> filteredRoute =
|
||||
* RouterFunctions.route()
|
||||
* .GET("/user", this::listUsers)
|
||||
* .onError(e -> e instanceof IllegalStateException,
|
||||
* (e, request) -> ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
|
||||
* .onError(e -> e instanceof IllegalStateException,
|
||||
* (e, request) -> ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
|
||||
* .build();
|
||||
* </pre>
|
||||
* @param predicate the type of exception to filter
|
||||
@@ -762,7 +762,7 @@ public abstract class RouterFunctions {
|
||||
* RouterFunctions.route()
|
||||
* .GET("/user", this::listUsers)
|
||||
* .onError(IllegalStateException.class,
|
||||
* (e, request) -> ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
|
||||
* (e, request) -> ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
|
||||
* .build();
|
||||
* </pre>
|
||||
* @param exceptionType the type of exception to filter
|
||||
|
||||
@@ -259,7 +259,7 @@ public interface ServerRequest {
|
||||
* public ServerResponse myHandleMethod(ServerRequest request) {
|
||||
* Instant lastModified = // application-specific calculation
|
||||
* return request.checkNotModified(lastModified)
|
||||
* .orElseGet(() -> {
|
||||
* .orElseGet(() -> {
|
||||
* // further request processing, actually building content
|
||||
* return ServerResponse.ok().body(...);
|
||||
* });
|
||||
@@ -293,7 +293,7 @@ public interface ServerRequest {
|
||||
* public ServerResponse myHandleMethod(ServerRequest request) {
|
||||
* String eTag = // application-specific calculation
|
||||
* return request.checkNotModified(eTag)
|
||||
* .orElseGet(() -> {
|
||||
* .orElseGet(() -> {
|
||||
* // further request processing, actually building content
|
||||
* return ServerResponse.ok().body(...);
|
||||
* });
|
||||
@@ -330,7 +330,7 @@ public interface ServerRequest {
|
||||
* Instant lastModified = // application-specific calculation
|
||||
* String eTag = // application-specific calculation
|
||||
* return request.checkNotModified(lastModified, eTag)
|
||||
* .orElseGet(() -> {
|
||||
* .orElseGet(() -> {
|
||||
* // further request processing, actually building content
|
||||
* return ServerResponse.ok().body(...);
|
||||
* });
|
||||
|
||||
@@ -266,14 +266,14 @@ public interface ServerResponse {
|
||||
* <p>For example:
|
||||
* <pre class="code">
|
||||
* public ServerResponse handleSse(ServerRequest request) {
|
||||
* return ServerResponse.sse(sse -> sse.send("Hello World!"));
|
||||
* return ServerResponse.sse(sse -> sse.send("Hello World!"));
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* <p>or, to set both the id and event type:
|
||||
* <pre class="code">
|
||||
* public ServerResponse handleSse(ServerRequest request) {
|
||||
* return ServerResponse.sse(sse -> sse
|
||||
* return ServerResponse.sse(sse -> sse
|
||||
* .id("42)
|
||||
* .event("event")
|
||||
* .send("Hello World!"));
|
||||
@@ -295,14 +295,14 @@ public interface ServerResponse {
|
||||
* <p>For example:
|
||||
* <pre class="code">
|
||||
* public ServerResponse handleSse(ServerRequest request) {
|
||||
* return ServerResponse.sse(sse -> sse.send("Hello World!"));
|
||||
* return ServerResponse.sse(sse -> sse.send("Hello World!"));
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* <p>or, to set both the id and event type:
|
||||
* <pre class="code">
|
||||
* public ServerResponse handleSse(ServerRequest request) {
|
||||
* return ServerResponse.sse(sse -> sse
|
||||
* return ServerResponse.sse(sse -> sse
|
||||
* .id("42)
|
||||
* .event("event")
|
||||
* .send("Hello World!"));
|
||||
|
||||
@@ -60,7 +60,6 @@ import org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver;
|
||||
* <p>This exception resolver is enabled by default in the common Spring
|
||||
* {@link org.springframework.web.servlet.DispatcherServlet}.
|
||||
*
|
||||
* <p>
|
||||
* <table>
|
||||
* <caption>Supported Exceptions</caption>
|
||||
* <thead>
|
||||
|
||||
@@ -244,7 +244,7 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
|
||||
* <ul>
|
||||
* <li>seconds == -1 (default value): no generation cache-related headers</li>
|
||||
* <li>seconds == 0: "Cache-Control: no-store" will prevent caching</li>
|
||||
* <li>seconds > 0: "Cache-Control: max-age=seconds" will ask to cache content</li>
|
||||
* <li>seconds > 0: "Cache-Control: max-age=seconds" will ask to cache content</li>
|
||||
* </ul>
|
||||
* <p>For more specific needs, a custom {@link org.springframework.http.CacheControl}
|
||||
* should be used.
|
||||
|
||||
@@ -51,7 +51,7 @@ import org.springframework.web.util.WebUtils;
|
||||
* </bean></pre>
|
||||
*
|
||||
* Every view name returned from a handler will be translated to a JSP
|
||||
* resource (for example: "myView" -> "/WEB-INF/jsp/myView.jsp"), using
|
||||
* resource (for example: "myView" → "/WEB-INF/jsp/myView.jsp"), using
|
||||
* this view class by default.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
|
||||
@@ -47,7 +47,7 @@ import org.springframework.web.servlet.support.RequestContext;
|
||||
* </bean></pre>
|
||||
*
|
||||
* Every view name returned from a handler will be translated to a JSP
|
||||
* resource (for example: "myView" -> "/WEB-INF/jsp/myView.jsp"), using
|
||||
* resource (for example: "myView" → "/WEB-INF/jsp/myView.jsp"), using
|
||||
* this view class to enable explicit JSTL support.
|
||||
*
|
||||
* <p>The specified MessageSource loads messages from "messages.properties" etc
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.springframework.web.servlet.View;
|
||||
* specified prefix and/or suffix. Exporting an attribute that holds the
|
||||
* RequestContext to all views is explicitly supported.
|
||||
*
|
||||
* <p>Example: prefix="/WEB-INF/jsp/", suffix=".jsp", viewname="test" ->
|
||||
* <p>Example: prefix="/WEB-INF/jsp/", suffix=".jsp", viewname="test" →
|
||||
* "/WEB-INF/jsp/test.jsp"
|
||||
*
|
||||
* <p>As a special feature, redirect URLs can be specified via the "redirect:"
|
||||
@@ -342,14 +342,16 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify whether views resolved by this resolver should add path variables to the model or not.
|
||||
* <p>>The default setting is to let each View decide (see {@link AbstractView#setExposePathVariables}.
|
||||
* However, you can use this property to override that.
|
||||
* Specify whether views resolved by this resolver should add path
|
||||
* variables to the model or not.
|
||||
* <p>The default setting is to let each View decide
|
||||
* (see {@link AbstractView#setExposePathVariables}). However, you
|
||||
* can use this property to override that.
|
||||
* @param exposePathVariables
|
||||
* <ul>
|
||||
* <li>{@code true} - all Views resolved by this resolver will expose path variables
|
||||
* <li>{@code false} - no Views resolved by this resolver will expose path variables
|
||||
* <li>{@code null} - individual Views can decide for themselves (this is used by the default)
|
||||
* <li>{@code null} - individual Views can decide for themselves (this is used by default)
|
||||
* </ul>
|
||||
* @see AbstractView#setExposePathVariables
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
* Abstract superclass for Atom Feed views, using the
|
||||
* <a href="https://github.com/rometools/rome">ROME</a> package.
|
||||
*
|
||||
* <p>><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
|
||||
* <p><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
|
||||
* variant of ROME, version 1.5. Please upgrade your build dependency.</b>
|
||||
*
|
||||
* <p>Application-specific view classes will extend this class.
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.web.servlet.view.AbstractView;
|
||||
* Abstract base class for Atom and RSS Feed views, using the
|
||||
* <a href="https://github.com/rometools/rome">ROME</a> package.
|
||||
*
|
||||
* <p>><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
|
||||
* <p><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
|
||||
* variant of ROME, version 1.5. Please upgrade your build dependency.</b>
|
||||
*
|
||||
* <p>Application-specific view classes will typically extend from either
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.http.MediaType;
|
||||
* Abstract superclass for RSS Feed views, using the
|
||||
* <a href="https://github.com/rometools/rome">ROME</a> package.
|
||||
*
|
||||
* <p>><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
|
||||
* <p><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
|
||||
* variant of ROME, version 1.5. Please upgrade your build dependency.</b>
|
||||
*
|
||||
* <p>Application-specific view classes will extend this class.
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* <pre class="code">
|
||||
* <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
|
||||
* <property name="templateLoaderPath"><value>/WEB-INF/freemarker/</value></property>
|
||||
* <property name="templateLoaderPath"><value>/WEB-INF/freemarker/</value></property>
|
||||
* </bean></pre>
|
||||
*
|
||||
* This bean must be included in the application context of any application
|
||||
|
||||
Reference in New Issue
Block a user