Fix and improve Javadoc in spring-webmvc
Closes gh-28789
This commit is contained in:
@@ -641,7 +641,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
* {@link org.springframework.web.context.ConfigurableWebApplicationContext}
|
||||
* interface. Can be overridden in subclasses.
|
||||
* <p>Do not forget to register this servlet instance as application listener on the
|
||||
* created context (for triggering its {@link #onRefresh callback}, and to call
|
||||
* created context (for triggering its {@link #onRefresh callback}), and to call
|
||||
* {@link org.springframework.context.ConfigurableApplicationContext#refresh()}
|
||||
* before returning the context instance.
|
||||
* @param parent the parent ApplicationContext to use, or {@code null} if none
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.springframework.lang.Nullable;
|
||||
* <p>Note: {@code HandlerAdapter} implementors may implement the {@link
|
||||
* org.springframework.core.Ordered} interface to be able to specify a sorting
|
||||
* order (and thus a priority) for getting applied by the {@code DispatcherServlet}.
|
||||
* Non-Ordered instances get treated as lowest priority.
|
||||
* Non-Ordered instances get treated as the lowest priority.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Juergen Hoeller
|
||||
@@ -50,7 +50,7 @@ import org.springframework.lang.Nullable;
|
||||
public interface HandlerAdapter {
|
||||
|
||||
/**
|
||||
* Given a handler instance, return whether or not this {@code HandlerAdapter}
|
||||
* Given a handler instance, return whether this {@code HandlerAdapter}
|
||||
* can support it. Typical HandlerAdapters will base the decision on the handler
|
||||
* type. HandlerAdapters will usually only support one handler type each.
|
||||
* <p>A typical implementation:
|
||||
@@ -58,7 +58,7 @@ public interface HandlerAdapter {
|
||||
* return (handler instanceof MyHandler);
|
||||
* }
|
||||
* @param handler the handler object to check
|
||||
* @return whether or not this object can use the given handler
|
||||
* @return whether this object can use the given handler
|
||||
*/
|
||||
boolean supports(Object handler);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ import org.springframework.lang.Nullable;
|
||||
*
|
||||
* <p>Note: Implementations can implement the {@link org.springframework.core.Ordered}
|
||||
* interface to be able to specify a sorting order and thus a priority for getting
|
||||
* applied by DispatcherServlet. Non-Ordered instances get treated as lowest priority.
|
||||
* applied by DispatcherServlet. Non-Ordered instances get treated as the lowest priority.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ModelAndView {
|
||||
@Nullable
|
||||
private HttpStatus status;
|
||||
|
||||
/** Indicates whether or not this instance has been cleared with a call to {@link #clear()}. */
|
||||
/** Indicates whether this instance has been cleared with a call to {@link #clear()}. */
|
||||
private boolean cleared = false;
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ public class ModelAndView {
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate whether or not this {@code ModelAndView} has a view, either
|
||||
* Indicate whether this {@code ModelAndView} has a view, either
|
||||
* as a view name or as a direct {@link View} instance.
|
||||
*/
|
||||
public boolean hasView() {
|
||||
|
||||
@@ -90,7 +90,7 @@ public class DefaultServletHandlerConfigurer {
|
||||
* Return a handler mapping instance ordered at {@link Ordered#LOWEST_PRECEDENCE}
|
||||
* containing the {@link DefaultServletHttpRequestHandler} instance mapped
|
||||
* to {@code "/**"}; or {@code null} if default servlet handling was not
|
||||
* been enabled.
|
||||
* enabled.
|
||||
* @since 4.3.12
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -1109,7 +1109,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
|
||||
/**
|
||||
* Register a {@link ViewResolverComposite} that contains a chain of view resolvers
|
||||
* to use for view resolution.
|
||||
* By default this resolver is ordered at 0 unless content negotiation view
|
||||
* By default, this resolver is ordered at 0 unless content negotiation view
|
||||
* resolution is used in which case the order is raised to
|
||||
* {@link org.springframework.core.Ordered#HIGHEST_PRECEDENCE
|
||||
* Ordered.HIGHEST_PRECEDENCE}.
|
||||
@@ -1167,7 +1167,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
|
||||
}
|
||||
|
||||
/**
|
||||
* Override this method to configure cross origin requests processing.
|
||||
* Override this method to configure cross-origin requests processing.
|
||||
* @since 4.2
|
||||
* @see CorsRegistry
|
||||
*/
|
||||
|
||||
@@ -105,7 +105,7 @@ public interface WebMvcConfigurer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure "global" cross origin request processing. The configured CORS
|
||||
* Configure "global" cross-origin request processing. The configured CORS
|
||||
* mappings apply to annotated controllers, functional endpoints, and static
|
||||
* resources.
|
||||
* <p>Annotated controllers can further declare more fine-grained config via
|
||||
|
||||
@@ -334,14 +334,14 @@ public abstract class RequestPredicates {
|
||||
void method(Set<HttpMethod> methods);
|
||||
|
||||
/**
|
||||
* Receive notification of an path predicate.
|
||||
* Receive notification of a path predicate.
|
||||
* @param pattern the path pattern that makes up the predicate
|
||||
* @see RequestPredicates#path(String)
|
||||
*/
|
||||
void path(String pattern);
|
||||
|
||||
/**
|
||||
* Receive notification of an path extension predicate.
|
||||
* Receive notification of a path extension predicate.
|
||||
* @param extension the path extension that makes up the predicate
|
||||
* @see RequestPredicates#pathExtension(String)
|
||||
*/
|
||||
|
||||
@@ -268,7 +268,7 @@ public interface ServerRequest {
|
||||
* also with conditional POST/PUT/DELETE requests.
|
||||
* <p><strong>Note:</strong> you can use either
|
||||
* this {@code #checkNotModified(Instant)} method; or
|
||||
* {@link #checkNotModified(String)}. If you want enforce both
|
||||
* {@link #checkNotModified(String)}. If you want to enforce both
|
||||
* a strong entity tag and a Last-Modified value,
|
||||
* as recommended by the HTTP specification,
|
||||
* then you should use {@link #checkNotModified(Instant, String)}.
|
||||
@@ -302,7 +302,7 @@ public interface ServerRequest {
|
||||
* also with conditional POST/PUT/DELETE requests.
|
||||
* <p><strong>Note:</strong> you can use either
|
||||
* this {@link #checkNotModified(Instant)} method; or
|
||||
* {@code #checkNotModified(String)}. If you want enforce both
|
||||
* {@code #checkNotModified(String)}. If you want to enforce both
|
||||
* a strong entity tag and a Last-Modified value,
|
||||
* as recommended by the HTTP specification,
|
||||
* then you should use {@link #checkNotModified(Instant, String)}.
|
||||
|
||||
@@ -150,7 +150,7 @@ public class RouterFunctionMapping extends AbstractHandlerMapping implements Ini
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect a all {@linkplain RouterFunction router functions} in the
|
||||
* Detect an all {@linkplain RouterFunction router functions} in the
|
||||
* current application context.
|
||||
*/
|
||||
private void initRouterFunctions() {
|
||||
|
||||
@@ -513,7 +513,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
|
||||
* Provide the mapping for a handler method. A method for which no
|
||||
* mapping can be provided is not a handler method.
|
||||
* @param method the method to provide a mapping for
|
||||
* @param handlerType the handler type, possibly a sub-type of the method's
|
||||
* @param handlerType the handler type, possibly a subtype of the method's
|
||||
* declaring class
|
||||
* @return the mapping, or {@code null} if the method is not mapped
|
||||
*/
|
||||
|
||||
@@ -48,7 +48,7 @@ import org.springframework.web.util.pattern.PatternParseException;
|
||||
* parsed} {@code RequestPath} which in turn depends on the
|
||||
* {@link HandlerMapping} that matched the current request.
|
||||
*
|
||||
* <p>{@code MappedInterceptor} is supported by sub-classes of
|
||||
* <p>{@code MappedInterceptor} is supported by subclasses of
|
||||
* {@link org.springframework.web.servlet.handler.AbstractHandlerMethodMapping
|
||||
* AbstractHandlerMethodMapping} which detect beans of type
|
||||
* {@code MappedInterceptor} and also check if interceptors directly registered
|
||||
|
||||
@@ -118,7 +118,7 @@ public class SimpleUrlHandlerMapping extends AbstractUrlHandlerMapping {
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow Map access to the URL path mappings, with the option to add or
|
||||
* Allow {@code Map} access to the URL path mappings, with the option to add or
|
||||
* override specific entries.
|
||||
* <p>Useful for specifying entries directly, for example via "urlMap[myKey]".
|
||||
* This is particularly useful for adding or overriding entries in child
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* Spring Controller implementation that wraps a servlet instance which it manages
|
||||
* internally. Such a wrapped servlet is not known outside of this controller;
|
||||
* internally. Such a wrapped servlet is not known outside this controller;
|
||||
* its entire lifecycle is covered here (in contrast to {@link ServletForwardingController}).
|
||||
*
|
||||
* <p>Useful to invoke an existing servlet via Spring's dispatching infrastructure,
|
||||
|
||||
@@ -56,7 +56,7 @@ import org.springframework.web.util.pattern.PathPatternParser;
|
||||
* {@link PathPattern}s. The syntax is largely the same with the latter being
|
||||
* more tailored for web usage and more efficient. The choice depends on the
|
||||
* presence of a {@link UrlPathHelper#resolveAndCacheLookupPath resolved}
|
||||
* {@code String} lookupPath or a {@link ServletRequestPathUtils#parseAndCache}
|
||||
* {@code String} lookupPath or a {@link ServletRequestPathUtils#parseAndCache
|
||||
* parsed} {@code RequestPath} which in turn depends on the
|
||||
* {@link HandlerMapping} that matched the current request.
|
||||
*
|
||||
@@ -182,7 +182,7 @@ public class WebContentInterceptor extends WebContentGenerator implements Handle
|
||||
/**
|
||||
* Map specific URL paths to a specific {@link org.springframework.http.CacheControl}.
|
||||
* <p>Overrides the default cache seconds setting of this interceptor.
|
||||
* Can specify a empty {@link org.springframework.http.CacheControl} instance
|
||||
* Can specify an empty {@link org.springframework.http.CacheControl} instance
|
||||
* to exclude a URL path from default caching.
|
||||
* <p>For pattern syntax see {@link AntPathMatcher} and {@link PathPattern}
|
||||
* as well as the class-level Javadoc for details for when each is used.
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.lang.Nullable;
|
||||
public abstract class AbstractRequestCondition<T extends AbstractRequestCondition<T>> implements RequestCondition<T> {
|
||||
|
||||
/**
|
||||
* Indicates whether this condition is empty, i.e. whether or not it
|
||||
* Indicates whether this condition is empty, i.e. whether it
|
||||
* contains any discrete items.
|
||||
* @return {@code true} if empty; {@code false} otherwise
|
||||
*/
|
||||
|
||||
@@ -62,7 +62,7 @@ public abstract class AbstractHandlerMethodAdapter extends WebContentGenerator i
|
||||
/**
|
||||
* This implementation expects the handler to be an {@link HandlerMethod}.
|
||||
* @param handler the handler instance to check
|
||||
* @return whether or not this adapter can adapt the given handler
|
||||
* @return whether this adapter can adapt the given handler
|
||||
*/
|
||||
@Override
|
||||
public final boolean supports(Object handler) {
|
||||
@@ -70,9 +70,9 @@ public abstract class AbstractHandlerMethodAdapter extends WebContentGenerator i
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a handler method, return whether or not this adapter can support it.
|
||||
* Given a handler method, return whether this adapter can support it.
|
||||
* @param handlerMethod the handler method to check
|
||||
* @return whether or not this adapter can adapt the given method
|
||||
* @return whether this adapter can adapt the given method
|
||||
*/
|
||||
protected abstract boolean supportsInternal(HandlerMethod handlerMethod);
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether there any partial matches.
|
||||
* Whether there is any partial matches.
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return this.partialMatches.isEmpty();
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.springframework.web.servlet.HandlerMapping;
|
||||
/**
|
||||
* Resolves arguments annotated with {@link MatrixVariable @MatrixVariable}.
|
||||
*
|
||||
* <p>If the method parameter is of type {@link Map} it will by resolved by
|
||||
* <p>If the method parameter is of type {@link Map} it will be resolved by
|
||||
* {@link MatrixVariableMapMethodArgumentResolver} instead unless the annotation
|
||||
* specifies a name in which case it is considered to be a single attribute of
|
||||
* type map (vs multiple attributes collected in a map).
|
||||
|
||||
@@ -389,7 +389,7 @@ public class MvcUriComponentsBuilder {
|
||||
* <p>The configured
|
||||
* {@link org.springframework.web.servlet.handler.HandlerMethodMappingNamingStrategy
|
||||
* HandlerMethodMappingNamingStrategy} determines the names of controller
|
||||
* method request mappings at startup. By default all mappings are assigned
|
||||
* method request mappings at startup. By default, all mappings are assigned
|
||||
* a name based on the capital letters of the class name, followed by "#" as
|
||||
* separator, and then the method name. For example "PC#getPerson"
|
||||
* for a class named PersonController with method getPerson. In case the
|
||||
@@ -643,7 +643,7 @@ public class MvcUriComponentsBuilder {
|
||||
contributor.contributeMethodArgument(param, args[i], builder, uriVars);
|
||||
}
|
||||
|
||||
// This may not be all the URI variables, supply what we have so far..
|
||||
// This may not be all the URI variables, supply what we have so far.
|
||||
return builder.uriVariables(uriVars);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public class RequestPartMethodArgumentResolver extends AbstractMessageConverterM
|
||||
|
||||
/**
|
||||
* Whether the given {@linkplain MethodParameter method parameter} is
|
||||
* supported as multi-part. Supports the following method parameters:
|
||||
* supported as multipart. Supports the following method parameters:
|
||||
* <ul>
|
||||
* <li>annotated with {@code @RequestPart}
|
||||
* <li>of type {@link MultipartFile} unless annotated with {@code @RequestParam}
|
||||
|
||||
@@ -48,7 +48,7 @@ import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
|
||||
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||
|
||||
/**
|
||||
* Handler for return values of type {@link ResponseBodyEmitter} and sub-classes
|
||||
* Handler for return values of type {@link ResponseBodyEmitter} and subclasses
|
||||
* such as {@link SseEmitter} including the same types wrapped with
|
||||
* {@link ResponseEntity}.
|
||||
*
|
||||
|
||||
@@ -118,7 +118,7 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
|
||||
/**
|
||||
* Create a model attribute from a String request value (e.g. URI template
|
||||
* variable, request parameter) using type conversion.
|
||||
* <p>The default implementation converts only if there a registered
|
||||
* <p>The default implementation converts only if there is a registered
|
||||
* {@link Converter} that can perform the conversion.
|
||||
* @param sourceValue the source value to create the model attribute from
|
||||
* @param attributeName the name of the attribute (never {@code null})
|
||||
|
||||
@@ -33,9 +33,9 @@ import org.springframework.web.servlet.RequestToViewNameTranslator;
|
||||
* as the actual return value is left as-is allowing the configured
|
||||
* {@link RequestToViewNameTranslator} to select a view name by convention.
|
||||
*
|
||||
* <p>A String return value can be interpreted in more than one ways depending on
|
||||
* <p>A String return value can be interpreted in more than one way depending on
|
||||
* the presence of annotations like {@code @ModelAttribute} or {@code @ResponseBody}.
|
||||
* Therefore this handler should be configured after the handlers that support these
|
||||
* Therefore, this handler should be configured after the handlers that support these
|
||||
* annotations.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
|
||||
@@ -290,7 +290,7 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes
|
||||
|
||||
/**
|
||||
* Handle the case where no {@linkplain org.springframework.http.converter.HttpMessageConverter message converters}
|
||||
* were found that were acceptable for the client (expressed via the {@code Accept} header.
|
||||
* were found that were acceptable for the client (expressed via the {@code Accept} header).
|
||||
* <p>The default implementation sends an HTTP 406 error and returns an empty {@code ModelAndView}.
|
||||
* Alternatively, a fallback view could be chosen, or the HttpMediaTypeNotAcceptableException
|
||||
* could be rethrown as-is.
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.util.DigestUtils;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
/**
|
||||
* A {@code VersionStrategy} that calculates an Hex MD5 hashes from the content
|
||||
* A {@code VersionStrategy} that calculates a Hex MD5 hash from the content
|
||||
* of the resource and appends it to the file name, e.g.
|
||||
* {@code "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css"}.
|
||||
*
|
||||
|
||||
@@ -66,7 +66,7 @@ public class PathResourceResolver extends AbstractResourceResolver {
|
||||
|
||||
|
||||
/**
|
||||
* By default when a Resource is found, the path of the resolved resource is
|
||||
* By default, when a Resource is found, the path of the resolved resource is
|
||||
* compared to ensure it's under the input location where it was found.
|
||||
* However sometimes that may not be the case, e.g. when
|
||||
* {@link org.springframework.web.servlet.resource.CssLinkResourceTransformer}
|
||||
|
||||
@@ -80,7 +80,7 @@ import org.springframework.web.util.UrlPathHelper;
|
||||
* <p>This request handler may also be configured with a
|
||||
* {@link #setResourceResolvers(List) resourcesResolver} and
|
||||
* {@link #setResourceTransformers(List) resourceTransformer} chains to support
|
||||
* arbitrary resolution and transformation of resources being served. By default
|
||||
* arbitrary resolution and transformation of resources being served. By default,
|
||||
* a {@link PathResourceResolver} simply finds resources based on the configured
|
||||
* "locations". An application can configure additional resolvers and transformers
|
||||
* such as the {@link VersionResourceResolver} which can resolve and prepare URLs
|
||||
@@ -525,7 +525,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator
|
||||
/**
|
||||
* Initialize the strategy to use to determine the media type for a resource.
|
||||
* @deprecated as of 5.2.4 this method returns {@code null}, and if a
|
||||
* sub-class returns an actual instance,the instance is used only as a
|
||||
* subclass returns an actual instance,the instance is used only as a
|
||||
* source of media type mappings, if it contains any. Please, use
|
||||
* {@link #setMediaTypes(Map)} instead, or if you need to change behavior,
|
||||
* you can override {@link #getMediaType(HttpServletRequest, Resource)}.
|
||||
@@ -717,7 +717,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifies invalid resource paths. By default rejects:
|
||||
* Identifies invalid resource paths. By default, rejects:
|
||||
* <ul>
|
||||
* <li>Paths that contain "WEB-INF" or "META-INF"
|
||||
* <li>Paths that contain "../" after a call to
|
||||
|
||||
@@ -116,7 +116,7 @@ public class VersionResourceResolver extends AbstractResourceResolver {
|
||||
* in Java config).
|
||||
* <p>If not done already, variants of the given {@code pathPatterns}, prefixed with
|
||||
* the {@code version} will be also configured. For example, adding a {@code "/js/**"} path pattern
|
||||
* will also cofigure automatically a {@code "/v1.0.0/js/**"} with {@code "v1.0.0"} the
|
||||
* will also configure automatically a {@code "/v1.0.0/js/**"} with {@code "v1.0.0"} the
|
||||
* {@code version} String given as an argument.
|
||||
* @param version a version string
|
||||
* @param pathPatterns one or more resource URL path patterns,
|
||||
|
||||
@@ -65,7 +65,7 @@ import org.springframework.web.util.WebUtils;
|
||||
* <p>Can be instantiated manually, or automatically exposed to views as model attribute via AbstractView's
|
||||
* "requestContextAttribute" property.
|
||||
*
|
||||
* <p>Will also work outside of DispatcherServlet requests, accessing the root WebApplicationContext
|
||||
* <p>Will also work outside DispatcherServlet requests, accessing the root WebApplicationContext
|
||||
* and using an appropriate fallback for the locale (the HttpServletRequest's primary locale).
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
@@ -134,7 +134,7 @@ public class RequestContext {
|
||||
* <p>This only works with InternalResourceViews, as Errors instances are part of the model and not
|
||||
* normally exposed as request attributes. It will typically be used within JSPs or custom tags.
|
||||
* <p><b>Will only work within a DispatcherServlet request.</b>
|
||||
* Pass in a ServletContext to be able to fallback to the root WebApplicationContext.
|
||||
* Pass in a ServletContext to be able to fall back to the root WebApplicationContext.
|
||||
* @param request current HTTP request
|
||||
* @see org.springframework.web.servlet.DispatcherServlet
|
||||
* @see #RequestContext(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext)
|
||||
@@ -148,7 +148,7 @@ public class RequestContext {
|
||||
* <p>This only works with InternalResourceViews, as Errors instances are part of the model and not
|
||||
* normally exposed as request attributes. It will typically be used within JSPs or custom tags.
|
||||
* <p><b>Will only work within a DispatcherServlet request.</b>
|
||||
* Pass in a ServletContext to be able to fallback to the root WebApplicationContext.
|
||||
* Pass in a ServletContext to be able to fall back to the root WebApplicationContext.
|
||||
* @param request current HTTP request
|
||||
* @param response current HTTP response
|
||||
* @see org.springframework.web.servlet.DispatcherServlet
|
||||
@@ -178,7 +178,7 @@ public class RequestContext {
|
||||
* Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.
|
||||
* <p>This works with all View implementations. It will typically be used by View implementations.
|
||||
* <p><b>Will only work within a DispatcherServlet request.</b>
|
||||
* Pass in a ServletContext to be able to fallback to the root WebApplicationContext.
|
||||
* Pass in a ServletContext to be able to fall back to the root WebApplicationContext.
|
||||
* @param request current HTTP request
|
||||
* @param model the model attributes for the current view (can be {@code null},
|
||||
* using the request attributes for Errors retrieval)
|
||||
|
||||
@@ -61,7 +61,7 @@ import org.springframework.web.util.JavaScriptUtils;
|
||||
* <td>false</td>
|
||||
* <td>true</td>
|
||||
* <td>Set JavaScript escaping for this tag, as boolean value.
|
||||
* Default is false.</td>
|
||||
* Default is {@code false}.</td>
|
||||
* </tr>
|
||||
* </tbody>
|
||||
* </table>
|
||||
|
||||
@@ -73,7 +73,7 @@ import org.springframework.web.util.TagUtils;
|
||||
* <td>false</td>
|
||||
* <td>true</td>
|
||||
* <td>Set JavaScript escaping for this tag, as a boolean value.
|
||||
* Default is false.</td>
|
||||
* Default is {@code false}.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>scope</td>
|
||||
|
||||
@@ -93,7 +93,7 @@ import org.springframework.web.util.TagUtils;
|
||||
* <td>false</td>
|
||||
* <td>true</td>
|
||||
* <td>Set JavaScript escaping for this tag, as boolean value.
|
||||
* Default is false.</td>
|
||||
* Default is {@code false}.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>message</td>
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.context.NoSuchMessageException;
|
||||
* Messages are looked up using the ApplicationContext's ThemeSource,
|
||||
* and thus should support internationalization.
|
||||
*
|
||||
* <p>Regards a HTML escaping setting, either on this tag instance,
|
||||
* <p>Regards an HTML escaping setting, either on this tag instance,
|
||||
* the page level, or the web.xml level.
|
||||
*
|
||||
* <p>If "code" isn't set or cannot be resolved, "text" will be used
|
||||
@@ -78,7 +78,7 @@ import org.springframework.context.NoSuchMessageException;
|
||||
* <td>false</td>
|
||||
* <td>true</td>
|
||||
* <td>Set JavaScript escaping for this tag, as boolean value.
|
||||
* Default is false.</td>
|
||||
* Default is {@code false}.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>message</td>
|
||||
|
||||
@@ -126,7 +126,7 @@ import org.springframework.web.util.UriUtils;
|
||||
* <td>false</td>
|
||||
* <td>true</td>
|
||||
* <td>Set JavaScript escaping for this tag, as a boolean value.
|
||||
* Default is false.</td>
|
||||
* Default is {@code false}.</td>
|
||||
* </tr>
|
||||
* </tbody>
|
||||
* </table>
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.springframework.web.servlet.tags.NestedPathTag;
|
||||
* Base tag for all data-binding aware JSP form tags.
|
||||
*
|
||||
* <p>Provides the common {@link #setPath path} and {@link #setId id} properties.
|
||||
* Provides sub-classes with utility methods for accessing the {@link BindStatus}
|
||||
* Provides subclasses with utility methods for accessing the {@link BindStatus}
|
||||
* of their bound value and also for {@link #writeOptionalAttribute interacting}
|
||||
* with the {@link TagWriter}.
|
||||
*
|
||||
@@ -111,10 +111,10 @@ public abstract class AbstractDataBoundFormElementTag extends AbstractFormTag im
|
||||
|
||||
/**
|
||||
* Writes the default set of attributes to the supplied {@link TagWriter}.
|
||||
* Further abstract sub-classes should override this method to add in
|
||||
* Further, abstract subclasses should override this method to add in
|
||||
* any additional default attributes but <strong>must</strong> remember
|
||||
* to call the {@code super} method.
|
||||
* <p>Concrete sub-classes should call this method when/if they want
|
||||
* <p>Concrete subclasses should call this method when/if they want
|
||||
* to render default attributes.
|
||||
* @param tagWriter the {@link TagWriter} to which any attributes are to be written
|
||||
*/
|
||||
|
||||
@@ -278,7 +278,7 @@ public class PasswordInputTag extends InputTag {
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@link PasswordInputTag} only writes it's value if the
|
||||
* The {@link PasswordInputTag} only writes its value if the
|
||||
* {@link #setShowPassword(boolean) 'showPassword'} property value is
|
||||
* {@link Boolean#TRUE true}.
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ import javax.servlet.jsp.JspException;
|
||||
* <p>Rendered elements are marked as 'checked' if the configured
|
||||
* {@link #setValue(Object) value} matches the {@link #getValue bound value}.
|
||||
*
|
||||
* <p>A typical usage pattern will involved multiple tag instances bound
|
||||
* <p>A typical usage pattern will involve multiple tag instances bound
|
||||
* to the same property but with different values.
|
||||
*
|
||||
* <p>
|
||||
|
||||
@@ -285,7 +285,7 @@ public class SelectTag extends AbstractHtmlInputElementTag {
|
||||
private String size;
|
||||
|
||||
/**
|
||||
* Indicates whether or not the '{@code select}' tag allows
|
||||
* Indicates whether the '{@code select}' tag allows
|
||||
* multiple-selections.
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -22,7 +22,7 @@ import javax.servlet.jsp.PageContext;
|
||||
* Utility class for generating '{@code id}' attributes values for JSP tags. Given the
|
||||
* name of a tag (the data bound path in most cases) returns a unique ID for that name within
|
||||
* the current {@link PageContext}. Each request for an ID for a given name will append an
|
||||
* ever increasing counter to the name itself. For instance, given the name '{@code person.name}',
|
||||
* ever-increasing counter to the name itself. For instance, given the name '{@code person.name}',
|
||||
* the first request will give '{@code person.name1}' and the second will give
|
||||
* '{@code person.name2}'. This supports the common use case where a set of radio or check buttons
|
||||
* are generated for the same data field, with each button being a distinct tag instance.
|
||||
|
||||
@@ -53,7 +53,7 @@ public class SessionThemeResolver extends AbstractThemeResolver {
|
||||
@Override
|
||||
public String resolveThemeName(HttpServletRequest request) {
|
||||
String themeName = (String) WebUtils.getSessionAttribute(request, THEME_SESSION_ATTRIBUTE_NAME);
|
||||
// A specific theme indicated, or do we need to fallback to the default?
|
||||
// A specific theme indicated, or do we need to fall back to the default?
|
||||
return (themeName != null ? themeName : getDefaultThemeName());
|
||||
}
|
||||
|
||||
|
||||
@@ -190,10 +190,10 @@ public abstract class AbstractView extends WebApplicationObjectSupport implement
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow Map access to the static attributes of this view,
|
||||
* Allow {@code Map} access to the static attributes of this view,
|
||||
* with the option to add or override specific entries.
|
||||
* <p>Useful for specifying entries directly, for example via
|
||||
* "attributesMap[myKey]". This is particularly useful for
|
||||
* {@code attributesMap[myKey]}. This is particularly useful for
|
||||
* adding or overriding entries in child view definitions.
|
||||
*/
|
||||
public Map<String, Object> getAttributesMap() {
|
||||
@@ -227,7 +227,7 @@ public abstract class AbstractView extends WebApplicationObjectSupport implement
|
||||
/**
|
||||
* Specify whether to add path variables to the model or not.
|
||||
* <p>Path variables are commonly bound to URI template variables through the {@code @PathVariable}
|
||||
* annotation. They're are effectively URI template variables with type conversion applied to
|
||||
* annotation. They are effectively URI template variables with type conversion applied to
|
||||
* them to derive typed Object values. Such values are frequently needed in views for
|
||||
* constructing links to the same and other URLs.
|
||||
* <p>Path variables added to the model override static attributes (see {@link #setAttributes(Properties)})
|
||||
|
||||
@@ -99,7 +99,7 @@ public class DefaultRequestToViewNameTranslator implements RequestToViewNameTran
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether or not leading slashes should be stripped from the URI when
|
||||
* Set whether leading slashes should be stripped from the URI when
|
||||
* generating the view name. Default is "true".
|
||||
*/
|
||||
public void setStripLeadingSlash(boolean stripLeadingSlash) {
|
||||
@@ -107,7 +107,7 @@ public class DefaultRequestToViewNameTranslator implements RequestToViewNameTran
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether or not trailing slashes should be stripped from the URI when
|
||||
* Set whether trailing slashes should be stripped from the URI when
|
||||
* generating the view name. Default is "true".
|
||||
*/
|
||||
public void setStripTrailingSlash(boolean stripTrailingSlash) {
|
||||
@@ -115,7 +115,7 @@ public class DefaultRequestToViewNameTranslator implements RequestToViewNameTran
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether or not file extensions should be stripped from the URI when
|
||||
* Set whether file extensions should be stripped from the URI when
|
||||
* generating the view name. Default is "true".
|
||||
*/
|
||||
public void setStripExtension(boolean stripExtension) {
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.springframework.web.util.WebUtils;
|
||||
/**
|
||||
* View that redirects to an absolute, context relative, or current request
|
||||
* relative URL. The URL may be a URI template in which case the URI template
|
||||
* variables will be replaced with values available in the model. By default
|
||||
* variables will be replaced with values available in the model. By default,
|
||||
* all primitive model attributes (or collections thereof) are exposed as HTTP
|
||||
* query parameters (assuming they've not been used as URI template variables),
|
||||
* but this behavior can be changed by overriding the
|
||||
@@ -159,7 +159,7 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
|
||||
* @param contextRelative whether to interpret the given URL as
|
||||
* relative to the current ServletContext
|
||||
* @param http10Compatible whether to stay compatible with HTTP 1.0 clients
|
||||
* @param exposeModelAttributes whether or not model attributes should be
|
||||
* @param exposeModelAttributes whether model attributes should be
|
||||
* exposed as query parameters
|
||||
*/
|
||||
public RedirectView(String url, boolean contextRelative, boolean http10Compatible, boolean exposeModelAttributes) {
|
||||
@@ -201,7 +201,7 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
|
||||
|
||||
/**
|
||||
* Set the {@code exposeModelAttributes} flag which denotes whether
|
||||
* or not model attributes should be exposed as HTTP query parameters.
|
||||
* model attributes should be exposed as HTTP query parameters.
|
||||
* <p>Defaults to {@code true}.
|
||||
*/
|
||||
public void setExposeModelAttributes(final boolean exposeModelAttributes) {
|
||||
@@ -640,7 +640,7 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
|
||||
* This method returns {@code true} if the {@link #setHosts(String[])}
|
||||
* property is configured and the target URL has a host that does not match.
|
||||
* @param targetUrl the target redirect URL
|
||||
* @return {@code true} the target URL has a remote host, {@code false} if it
|
||||
* @return {@code true} the target URL has a remote host, {@code false} if
|
||||
* the URL does not have a host or the "host" property is not configured.
|
||||
* @since 4.3
|
||||
*/
|
||||
|
||||
@@ -331,10 +331,10 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow Map access to the static attributes for views returned by
|
||||
* Allow {@code Map} access to the static attributes for views returned by
|
||||
* this resolver, with the option to add or override specific entries.
|
||||
* <p>Useful for specifying entries directly, for example via
|
||||
* "attributesMap[myKey]". This is particularly useful for
|
||||
* {@code attributesMap[myKey]}. This is particularly useful for
|
||||
* adding or overriding entries in child view definitions.
|
||||
*/
|
||||
public Map<String, Object> getAttributesMap() {
|
||||
@@ -492,7 +492,7 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether or not this {@link org.springframework.web.servlet.ViewResolver} can
|
||||
* Indicates whether this {@link org.springframework.web.servlet.ViewResolver} can
|
||||
* handle the supplied view name. If not, {@link #createView(String, java.util.Locale)} will
|
||||
* return {@code null}. The default implementation checks against the configured
|
||||
* {@link #setViewNames view names}.
|
||||
|
||||
@@ -100,7 +100,7 @@ public abstract class AbstractPdfStamperView extends AbstractUrlBasedView {
|
||||
*
|
||||
* // set some values on the form
|
||||
* form.setField("field1", "value1");
|
||||
* form.setField("field2", "Vvlue2");
|
||||
* form.setField("field2", "Value2");
|
||||
*
|
||||
* // set the disposition and filename
|
||||
* response.setHeader("Content-disposition", "attachment; FILENAME=someName.pdf");</pre>
|
||||
|
||||
@@ -94,7 +94,7 @@ import static org.springframework.http.MediaType.APPLICATION_JSON;
|
||||
import static org.springframework.http.MediaType.APPLICATION_XML;
|
||||
|
||||
/**
|
||||
* A test fixture with a sub-class of {@link WebMvcConfigurationSupport} that also
|
||||
* A test fixture with a subclass of {@link WebMvcConfigurationSupport} that also
|
||||
* implements the various {@link WebMvcConfigurer} extension points.
|
||||
*
|
||||
* The former doesn't implement the latter but the two must have compatible
|
||||
|
||||
@@ -321,7 +321,7 @@ class RequestMappingInfoHandlerMappingTests {
|
||||
assertThat(matrixVariables.getFirst("year")).isEqualTo("2012");
|
||||
assertThat(uriVariables.get("cars")).isEqualTo("cars");
|
||||
|
||||
// URI var with regex for path variable, and URI var for matrix params..
|
||||
// URI var with regex for path variable, and URI var for matrix params.
|
||||
request = new MockHttpServletRequest("GET", "/cars;colors=red,blue,green;year=2012");
|
||||
handleMatch(mapping, request, "/{cars:[^;]+}{params}", request.getRequestURI());
|
||||
|
||||
@@ -336,7 +336,7 @@ class RequestMappingInfoHandlerMappingTests {
|
||||
assertThat(uriVariables.get("params")).isEqualTo(";colors=red,blue,green;year=2012");
|
||||
}
|
||||
|
||||
// URI var with regex for path variable, and (empty) URI var for matrix params..
|
||||
// URI var with regex for path variable, and (empty) URI var for matrix params.
|
||||
request = new MockHttpServletRequest("GET", "/cars");
|
||||
handleMatch(mapping, request, "/{cars:[^;]+}{params}", request.getRequestURI());
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ import static org.mockito.Mockito.mock;
|
||||
|
||||
/**
|
||||
* Base class for {@code @RequestAttribute} and {@code @SessionAttribute} method
|
||||
* method argument resolution tests.
|
||||
* argument resolution tests.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.3
|
||||
|
||||
@@ -359,7 +359,7 @@ public class RequestMappingHandlerAdapterIntegrationTests {
|
||||
assertThat(response.getStatus()).isEqualTo(HttpStatus.ACCEPTED.value());
|
||||
assertThat(new String(response.getContentAsByteArray(), "UTF-8")).isEqualTo("Handled requestBody=[Hello Server]");
|
||||
assertThat(response.getHeader("header")).isEqualTo("headerValue");
|
||||
// set because of @SesstionAttributes
|
||||
// set because of @SessionAttributes
|
||||
assertThat(response.getHeader("Cache-Control")).isEqualTo("no-store");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user