mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Polish
This commit is contained in:
-1
@@ -20,7 +20,6 @@ import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
-3
@@ -59,9 +59,6 @@ import org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolv
|
||||
*/
|
||||
public class RequestResponseBodyMethodProcessor extends AbstractMessageConverterMethodProcessor {
|
||||
|
||||
private static final List<HttpMethod> SUPPORTED_METHODS =
|
||||
Arrays.asList(HttpMethod.POST, HttpMethod.PUT, HttpMethod.PATCH);
|
||||
|
||||
/**
|
||||
* Basic constructor with converters only. Suitable for resolving
|
||||
* {@code @RequestBody}. For handling {@code @ResponseBody} consider also
|
||||
|
||||
+1
-1
@@ -170,7 +170,7 @@ public class AppCacheManifestTransformer extends ResourceTransformerSupport {
|
||||
|
||||
private class CacheSection implements SectionTransformer {
|
||||
|
||||
private final String COMMENT_DIRECTIVE = "#";
|
||||
private static final String COMMENT_DIRECTIVE = "#";
|
||||
|
||||
@Override
|
||||
public String transform(String line, HashBuilder builder, Resource resource,
|
||||
|
||||
+21
-4
@@ -199,6 +199,8 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
|
||||
|
||||
/**
|
||||
* Return whether the HTTP 1.0 expires header is used.
|
||||
*
|
||||
* @deprecated in favor of {@link #getCacheControl}.
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean isUseExpiresHeader() {
|
||||
@@ -220,6 +222,8 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
|
||||
|
||||
/**
|
||||
* Return whether the HTTP 1.1 cache-control header is used.
|
||||
*
|
||||
* @deprecated in favor of {@link #getCacheControl}.
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean isUseCacheControlHeader() {
|
||||
@@ -240,6 +244,8 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
|
||||
|
||||
/**
|
||||
* Return whether the HTTP 1.1 cache-control header value "no-store" is used.
|
||||
*
|
||||
* @deprecated in favor of {@link #getCacheControl}.
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean isUseCacheControlNoStore() {
|
||||
@@ -262,6 +268,8 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
|
||||
|
||||
/**
|
||||
* Return whether 'must-revalidate' is added to every Cache-Control header.
|
||||
*
|
||||
* @deprecated in favor of {@link #getCacheControl}.
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isAlwaysMustRevalidate() {
|
||||
@@ -315,6 +323,17 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
|
||||
checkAndPrepare(request, response, this.cacheControl);
|
||||
}
|
||||
|
||||
/**
|
||||
* * Check and prepare the given request and response according to the settings
|
||||
* of this generator. Checks for supported methods and a required session,
|
||||
* and applies the number of cache seconds specified for this generator.
|
||||
* @param request current HTTP request
|
||||
* @param response current HTTP response
|
||||
* @param lastModified whether the underlying handler writes "Last-Modified" headers; in that case,
|
||||
* a "Cache-Control: must-revalidate" directive is set in the response.
|
||||
* @throws ServletException if the request cannot be handled because a check failed
|
||||
* @deprecated in favor of {@link #checkAndPrepare(HttpServletRequest, HttpServletResponse, CacheControl)}.
|
||||
*/
|
||||
@Deprecated
|
||||
protected final void checkAndPrepare(
|
||||
HttpServletRequest request, HttpServletResponse response, boolean lastModified)
|
||||
@@ -362,10 +381,8 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
|
||||
}
|
||||
|
||||
// Check whether a session is required.
|
||||
if (this.requireSession) {
|
||||
if (request.getSession(false) == null) {
|
||||
throw new HttpSessionRequiredException("Pre-existing session required but none found");
|
||||
}
|
||||
if (this.requireSession && request.getSession(false) == null) {
|
||||
throw new HttpSessionRequiredException("Pre-existing session required but none found");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -18,7 +18,6 @@ package org.springframework.web.servlet.mvc;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
|
||||
Reference in New Issue
Block a user