Added @Override and @Deprecated annotations to web-servlet module
This commit is contained in:
@@ -41,6 +41,7 @@ public class MissingServletRequestParameterException extends ServletRequestBindi
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "Required " + this.parameterType + " parameter '" + this.parameterName + "' is not present";
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
* @deprecated as of Spring 2.0: use ServletRequestUtils instead
|
||||
* @see ServletRequestUtils
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class RequestUtils {
|
||||
|
||||
/**
|
||||
|
||||
@@ -546,10 +546,12 @@ public abstract class ServletRequestUtils {
|
||||
|
||||
private static class IntParser extends ParameterParser {
|
||||
|
||||
@Override
|
||||
protected String getType() {
|
||||
return "int";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object doParse(String s) throws NumberFormatException {
|
||||
return Integer.valueOf(s);
|
||||
}
|
||||
@@ -571,10 +573,12 @@ public abstract class ServletRequestUtils {
|
||||
|
||||
private static class LongParser extends ParameterParser {
|
||||
|
||||
@Override
|
||||
protected String getType() {
|
||||
return "long";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object doParse(String parameter) throws NumberFormatException {
|
||||
return Long.valueOf(parameter);
|
||||
}
|
||||
@@ -596,10 +600,12 @@ public abstract class ServletRequestUtils {
|
||||
|
||||
private static class FloatParser extends ParameterParser {
|
||||
|
||||
@Override
|
||||
protected String getType() {
|
||||
return "float";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object doParse(String parameter) throws NumberFormatException {
|
||||
return Float.valueOf(parameter);
|
||||
}
|
||||
@@ -621,10 +627,12 @@ public abstract class ServletRequestUtils {
|
||||
|
||||
private static class DoubleParser extends ParameterParser {
|
||||
|
||||
@Override
|
||||
protected String getType() {
|
||||
return "double";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object doParse(String parameter) throws NumberFormatException {
|
||||
return Double.valueOf(parameter);
|
||||
}
|
||||
@@ -646,10 +654,12 @@ public abstract class ServletRequestUtils {
|
||||
|
||||
private static class BooleanParser extends ParameterParser {
|
||||
|
||||
@Override
|
||||
protected String getType() {
|
||||
return "boolean";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object doParse(String parameter) throws NumberFormatException {
|
||||
return (parameter.equalsIgnoreCase("true") || parameter.equalsIgnoreCase("on") ||
|
||||
parameter.equalsIgnoreCase("yes") || parameter.equals("1") ? Boolean.TRUE : Boolean.FALSE);
|
||||
@@ -672,10 +682,12 @@ public abstract class ServletRequestUtils {
|
||||
|
||||
private static class StringParser extends ParameterParser {
|
||||
|
||||
@Override
|
||||
protected String getType() {
|
||||
return "string";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object doParse(String parameter) throws NumberFormatException {
|
||||
return parameter;
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ public class WebDataBinder extends DataBinder {
|
||||
* before delegating to the superclass binding process.
|
||||
* @see #checkFieldMarkers
|
||||
*/
|
||||
@Override
|
||||
protected void doBind(MutablePropertyValues mpvs) {
|
||||
checkFieldMarkers(mpvs);
|
||||
super.doBind(mpvs);
|
||||
|
||||
@@ -111,6 +111,7 @@ public class CommonsMultipartResolver extends CommonsFileUploadSupport
|
||||
* @param fileItemFactory the Commons FileItemFactory to use
|
||||
* @return the new ServletFileUpload instance
|
||||
*/
|
||||
@Override
|
||||
protected FileUpload newFileUpload(FileItemFactory fileItemFactory) {
|
||||
return new ServletFileUpload(fileItemFactory);
|
||||
}
|
||||
@@ -138,6 +139,7 @@ public class CommonsMultipartResolver extends CommonsFileUploadSupport
|
||||
Assert.notNull(request, "Request must not be null");
|
||||
if (this.resolveLazily) {
|
||||
return new DefaultMultipartHttpServletRequest(request) {
|
||||
@Override
|
||||
protected void initializeMultipart() {
|
||||
MultipartParsingResult parsingResult = parseRequest(request);
|
||||
setMultipartFiles(parsingResult.getMultipartFiles());
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
*/
|
||||
public class ByteArrayMultipartFileEditor extends ByteArrayPropertyEditor {
|
||||
|
||||
@Override
|
||||
public void setValue(Object value) {
|
||||
if (value instanceof MultipartFile) {
|
||||
MultipartFile multipartFile = (MultipartFile) value;
|
||||
@@ -50,6 +51,7 @@ public class ByteArrayMultipartFileEditor extends ByteArrayPropertyEditor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAsText() {
|
||||
byte[] value = (byte[]) getValue();
|
||||
return (value != null ? new String(value) : "");
|
||||
|
||||
@@ -64,6 +64,7 @@ public class DefaultMultipartHttpServletRequest extends AbstractMultipartHttpSer
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Enumeration getParameterNames() {
|
||||
Set paramNames = new HashSet();
|
||||
Enumeration paramEnum = super.getParameterNames();
|
||||
@@ -74,6 +75,7 @@ public class DefaultMultipartHttpServletRequest extends AbstractMultipartHttpSer
|
||||
return Collections.enumeration(paramNames);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParameter(String name) {
|
||||
String[] values = (String[]) getMultipartParameters().get(name);
|
||||
if (values != null) {
|
||||
@@ -82,6 +84,7 @@ public class DefaultMultipartHttpServletRequest extends AbstractMultipartHttpSer
|
||||
return super.getParameter(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParameterValues(String name) {
|
||||
String[] values = (String[]) getMultipartParameters().get(name);
|
||||
if (values != null) {
|
||||
@@ -90,6 +93,7 @@ public class DefaultMultipartHttpServletRequest extends AbstractMultipartHttpSer
|
||||
return super.getParameterValues(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map getParameterMap() {
|
||||
Map paramMap = new HashMap();
|
||||
paramMap.putAll(super.getParameterMap());
|
||||
|
||||
@@ -88,6 +88,7 @@ public class MultipartFilter extends OncePerRequestFilter {
|
||||
* from proper parameter extraction in the multipart case, and are able to cast to
|
||||
* MultipartHttpServletRequest if they need to.
|
||||
*/
|
||||
@Override
|
||||
protected void doFilterInternal(
|
||||
HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
|
||||
throws ServletException, IOException {
|
||||
|
||||
@@ -52,10 +52,12 @@ public class StringMultipartFileEditor extends PropertyEditorSupport {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setAsText(String text) {
|
||||
setValue(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Object value) {
|
||||
if (value instanceof MultipartFile) {
|
||||
MultipartFile multipartFile = (MultipartFile) value;
|
||||
|
||||
@@ -394,6 +394,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
/**
|
||||
* This implementation calls {@link #initStrategies}.
|
||||
*/
|
||||
@Override
|
||||
protected void onRefresh(ApplicationContext context) throws BeansException {
|
||||
initStrategies(context);
|
||||
}
|
||||
@@ -775,6 +776,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
* Exposes the DispatcherServlet-specific request attributes and
|
||||
* delegates to {@link #doDispatch} for the actual dispatching.
|
||||
*/
|
||||
@Override
|
||||
protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
if (logger.isDebugEnabled()) {
|
||||
String requestUri = new UrlPathHelper().getRequestUri(request);
|
||||
@@ -949,6 +951,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
* Override HttpServlet's <code>getLastModified</code> method to evaluate
|
||||
* the Last-Modified value of the mapped handler.
|
||||
*/
|
||||
@Override
|
||||
protected long getLastModified(HttpServletRequest request) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
String requestUri = new UrlPathHelper().getRequestUri(request);
|
||||
@@ -992,6 +995,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
public Locale getLocale() {
|
||||
return localeResolver.resolveLocale(request);
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return getLocale().toString();
|
||||
}
|
||||
|
||||
@@ -271,6 +271,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
* Overridden method of {@link HttpServletBean}, invoked after any bean properties
|
||||
* have been set. Creates this servlet's WebApplicationContext.
|
||||
*/
|
||||
@Override
|
||||
protected final void initServletBean() throws ServletException, BeansException {
|
||||
getServletContext().log("Initializing Spring FrameworkServlet '" + getServletName() + "'");
|
||||
if (this.logger.isInfoEnabled()) {
|
||||
@@ -495,6 +496,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
* @see #doService
|
||||
* @see #doHead
|
||||
*/
|
||||
@Override
|
||||
protected final void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
@@ -505,6 +507,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
* Delegate POST requests to {@link #processRequest}.
|
||||
* @see #doService
|
||||
*/
|
||||
@Override
|
||||
protected final void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
@@ -515,6 +518,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
* Delegate PUT requests to {@link #processRequest}.
|
||||
* @see #doService
|
||||
*/
|
||||
@Override
|
||||
protected final void doPut(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
@@ -525,6 +529,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
* Delegate DELETE requests to {@link #processRequest}.
|
||||
* @see #doService
|
||||
*/
|
||||
@Override
|
||||
protected final void doDelete(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
@@ -536,6 +541,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
* <p>Applies HttpServlet's standard OPTIONS processing first.
|
||||
* @see #doService
|
||||
*/
|
||||
@Override
|
||||
protected void doOptions(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
super.doOptions(request, response);
|
||||
if (this.dispatchOptionsRequest) {
|
||||
@@ -548,6 +554,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
* <p>Applies HttpServlet's standard TRACE processing first.
|
||||
* @see #doService
|
||||
*/
|
||||
@Override
|
||||
protected void doTrace(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
super.doTrace(request, response);
|
||||
if (this.dispatchTraceRequest) {
|
||||
@@ -637,6 +644,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
* Close the WebApplicationContext of this servlet.
|
||||
* @see org.springframework.context.ConfigurableApplicationContext#close()
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
getServletContext().log("Destroying Spring FrameworkServlet '" + getServletName() + "'");
|
||||
if (this.webApplicationContext instanceof ConfigurableApplicationContext) {
|
||||
|
||||
@@ -116,6 +116,7 @@ public class HandlerExecutionChain {
|
||||
/**
|
||||
* Delegates to the handler's <code>toString()</code>.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(handler);
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ public abstract class HttpServletBean extends HttpServlet {
|
||||
* @throws ServletException if bean properties are invalid (or required
|
||||
* properties are missing), or if subclass initialization fails.
|
||||
*/
|
||||
@Override
|
||||
public final void init() throws ServletException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initializing servlet '" + getServletName() + "'");
|
||||
@@ -147,6 +148,7 @@ public abstract class HttpServletBean extends HttpServlet {
|
||||
* ServletConfig set yet.
|
||||
* @see #getServletConfig()
|
||||
*/
|
||||
@Override
|
||||
public final String getServletName() {
|
||||
return (getServletConfig() != null ? getServletConfig().getServletName() : null);
|
||||
}
|
||||
@@ -156,6 +158,7 @@ public abstract class HttpServletBean extends HttpServlet {
|
||||
* ServletConfig set yet.
|
||||
* @see #getServletConfig()
|
||||
*/
|
||||
@Override
|
||||
public final ServletContext getServletContext() {
|
||||
return (getServletConfig() != null ? getServletConfig().getServletContext() : null);
|
||||
}
|
||||
|
||||
@@ -289,6 +289,7 @@ public class ModelAndView {
|
||||
/**
|
||||
* Return diagnostic information about this model and view.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer buf = new StringBuffer("ModelAndView: ");
|
||||
if (isReference()) {
|
||||
|
||||
@@ -168,6 +168,7 @@ public class ResourceServlet extends HttpServletBean {
|
||||
/**
|
||||
* Remember the startup time, using no last-modified time before it.
|
||||
*/
|
||||
@Override
|
||||
protected void initServletBean() {
|
||||
this.pathMatcher = getPathMatcher();
|
||||
this.startupTime = System.currentTimeMillis();
|
||||
@@ -188,6 +189,7 @@ public class ResourceServlet extends HttpServletBean {
|
||||
* Determine the URL of the target resource and include it.
|
||||
* @see #determineResourceUrl
|
||||
*/
|
||||
@Override
|
||||
protected final void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
@@ -297,6 +299,7 @@ public class ResourceServlet extends HttpServletBean {
|
||||
* @see #determineResourceUrl
|
||||
* @see #getFileTimestamp
|
||||
*/
|
||||
@Override
|
||||
protected final long getLastModified(HttpServletRequest request) {
|
||||
if (this.applyLastModified) {
|
||||
String resourceUrl = determineResourceUrl(request);
|
||||
|
||||
@@ -59,12 +59,14 @@ public class ViewRendererServlet extends HttpServlet {
|
||||
public static final String MODEL_ATTRIBUTE = ViewRendererServlet.class.getName() + ".MODEL";
|
||||
|
||||
|
||||
@Override
|
||||
protected final void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
processRequest(request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ public abstract class AbstractDetectingUrlHandlerMapping extends AbstractUrlHand
|
||||
* Calls the {@link #detectHandlers()} method in addition to the
|
||||
* superclass's initialization.
|
||||
*/
|
||||
@Override
|
||||
public void initApplicationContext() throws ApplicationContextException {
|
||||
super.initApplicationContext();
|
||||
detectHandlers();
|
||||
|
||||
@@ -105,6 +105,7 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
* @see #extendInterceptors(java.util.List)
|
||||
* @see #initInterceptors()
|
||||
*/
|
||||
@Override
|
||||
protected void initApplicationContext() throws BeansException {
|
||||
extendInterceptors(this.interceptors);
|
||||
initInterceptors();
|
||||
|
||||
@@ -154,6 +154,7 @@ public abstract class AbstractUrlHandlerMapping extends AbstractHandlerMapping {
|
||||
* @param request current HTTP request
|
||||
* @return the handler instance, or <code>null</code> if none found
|
||||
*/
|
||||
@Override
|
||||
protected Object getHandlerInternal(HttpServletRequest request) throws Exception {
|
||||
String lookupPath = this.urlPathHelper.getLookupPathForRequest(request);
|
||||
Object handler = lookupHandler(lookupPath, request);
|
||||
@@ -353,6 +354,7 @@ public abstract class AbstractUrlHandlerMapping extends AbstractHandlerMapping {
|
||||
this.pathWithinMapping = pathWithinMapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||
exposePathWithinMapping(this.pathWithinMapping, request);
|
||||
return true;
|
||||
|
||||
@@ -53,6 +53,7 @@ public class BeanNameUrlHandlerMapping extends AbstractDetectingUrlHandlerMappin
|
||||
/**
|
||||
* Checks name and aliases of the given bean for URLs, starting with "/".
|
||||
*/
|
||||
@Override
|
||||
protected String[] determineUrlsForHandler(String beanName) {
|
||||
List urls = new ArrayList();
|
||||
if (beanName.startsWith("/")) {
|
||||
|
||||
@@ -44,6 +44,7 @@ public class DispatcherServletWebRequest extends ServletWebRequest {
|
||||
super(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Locale getLocale() {
|
||||
return RequestContextUtils.getLocale(getRequest());
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ public class SimpleUrlHandlerMapping extends AbstractUrlHandlerMapping {
|
||||
* Calls the {@link #registerHandlers} method in addition to the
|
||||
* superclass's initialization.
|
||||
*/
|
||||
@Override
|
||||
public void initApplicationContext() throws BeansException {
|
||||
super.initApplicationContext();
|
||||
registerHandlers(this.urlMap);
|
||||
|
||||
@@ -44,6 +44,7 @@ public class UserRoleAuthorizationInterceptor extends HandlerInterceptorAdapter
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||
throws ServletException, IOException {
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ import org.springframework.web.servlet.handler.AbstractUrlHandlerMapping;
|
||||
* @deprecated as of Spring 2.5, in favor of annotation-based request mapping.
|
||||
* To be removed in Spring 3.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class AbstractPathMapHandlerMapping extends AbstractUrlHandlerMapping {
|
||||
|
||||
/** Constants instance for AutowireCapableBeanFactory */
|
||||
@@ -104,6 +105,7 @@ public abstract class AbstractPathMapHandlerMapping extends AbstractUrlHandlerMa
|
||||
* to the superclass's initialization.
|
||||
* @see #detectAndCreateHandlers
|
||||
*/
|
||||
@Override
|
||||
public void initApplicationContext() throws BeansException {
|
||||
super.initApplicationContext();
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ import org.apache.commons.attributes.Attributes;
|
||||
* @deprecated as of Spring 2.5, in favor of annotation-based request mapping.
|
||||
* To be removed in Spring 3.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public class CommonsPathMapHandlerMapping extends AbstractPathMapHandlerMapping {
|
||||
|
||||
/**
|
||||
@@ -62,6 +63,7 @@ public class CommonsPathMapHandlerMapping extends AbstractPathMapHandlerMapping
|
||||
* objects with the required PathMap attribute. Protected so that it can
|
||||
* be overridden during testing.
|
||||
*/
|
||||
@Override
|
||||
protected Class[] getClassesWithPathMapAttributes() throws Exception {
|
||||
AttributeIndex ai = new AttributeIndex(getClass().getClassLoader());
|
||||
Collection classes = ai.getClasses(PathMap.class);
|
||||
@@ -73,6 +75,7 @@ public class CommonsPathMapHandlerMapping extends AbstractPathMapHandlerMapping
|
||||
* We know there's at least one, as the getClassNamesWithPathMapAttributes
|
||||
* method return this class name.
|
||||
*/
|
||||
@Override
|
||||
protected PathMap[] getPathMapAttributes(Class handlerClass) {
|
||||
Collection atts = Attributes.getAttributes(handlerClass, PathMap.class);
|
||||
return (PathMap[]) atts.toArray(new PathMap[atts.size()]);
|
||||
|
||||
@@ -30,6 +30,7 @@ package org.springframework.web.servlet.handler.metadata;
|
||||
* To be removed in Spring 3.0.
|
||||
* @@org.apache.commons.attributes.Indexed()
|
||||
*/
|
||||
@Deprecated
|
||||
public class PathMap {
|
||||
|
||||
/*
|
||||
|
||||
@@ -62,6 +62,7 @@ public class LocaleChangeInterceptor extends HandlerInterceptorAdapter {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||
throws ServletException {
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ public abstract class AbstractCommandController extends BaseCommandController {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
|
||||
|
||||
@@ -252,6 +252,7 @@ public abstract class AbstractFormController extends BaseCommandController {
|
||||
* @see #showNewForm
|
||||
* @see #processFormSubmission
|
||||
*/
|
||||
@Override
|
||||
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
|
||||
@@ -425,6 +426,7 @@ public abstract class AbstractFormController extends BaseCommandController {
|
||||
* @throws Exception in case of invalid state or arguments
|
||||
* @see #formBackingObject
|
||||
*/
|
||||
@Override
|
||||
protected final Object getCommand(HttpServletRequest request) throws Exception {
|
||||
// If not in session-form mode, create a new form-backing object.
|
||||
if (!isSessionForm()) {
|
||||
|
||||
@@ -88,6 +88,7 @@ public abstract class AbstractUrlViewController extends AbstractController {
|
||||
* Retrieves the URL path to use for lookup and delegates to
|
||||
* {@link #getViewNameForRequest}.
|
||||
*/
|
||||
@Override
|
||||
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) {
|
||||
String lookupPath = getUrlPathHelper().getLookupPathForRequest(request);
|
||||
String viewName = getViewNameForRequest(request);
|
||||
|
||||
@@ -222,6 +222,7 @@ public abstract class AbstractWizardFormController extends AbstractFormControlle
|
||||
/**
|
||||
* Calls page-specific onBindAndValidate method.
|
||||
*/
|
||||
@Override
|
||||
protected final void onBindAndValidate(HttpServletRequest request, Object command, BindException errors)
|
||||
throws Exception {
|
||||
|
||||
@@ -253,6 +254,7 @@ public abstract class AbstractWizardFormController extends AbstractFormControlle
|
||||
* @see #isFinishRequest(javax.servlet.http.HttpServletRequest)
|
||||
* @see #isCancelRequest(javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
@Override
|
||||
protected boolean isFormSubmission(HttpServletRequest request) {
|
||||
return super.isFormSubmission(request) || isFinishRequest(request) || isCancelRequest(request);
|
||||
}
|
||||
@@ -260,6 +262,7 @@ public abstract class AbstractWizardFormController extends AbstractFormControlle
|
||||
/**
|
||||
* Calls page-specific referenceData method.
|
||||
*/
|
||||
@Override
|
||||
protected final Map referenceData(HttpServletRequest request, Object command, Errors errors)
|
||||
throws Exception {
|
||||
|
||||
@@ -307,6 +310,7 @@ public abstract class AbstractWizardFormController extends AbstractFormControlle
|
||||
* <p>This can be overridden in subclasses, e.g. to prepare wizard-specific
|
||||
* error views in case of an Exception.
|
||||
*/
|
||||
@Override
|
||||
protected ModelAndView showForm(
|
||||
HttpServletRequest request, HttpServletResponse response, BindException errors)
|
||||
throws Exception {
|
||||
@@ -451,6 +455,7 @@ public abstract class AbstractWizardFormController extends AbstractFormControlle
|
||||
* @see #showNewForm
|
||||
* @see #setBindOnNewForm
|
||||
*/
|
||||
@Override
|
||||
protected ModelAndView handleInvalidSubmit(HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
|
||||
@@ -461,6 +466,7 @@ public abstract class AbstractWizardFormController extends AbstractFormControlle
|
||||
/**
|
||||
* Apply wizard workflow: finish, cancel, page change.
|
||||
*/
|
||||
@Override
|
||||
protected final ModelAndView processFormSubmission(
|
||||
HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
|
||||
throws Exception {
|
||||
|
||||
@@ -319,6 +319,7 @@ public abstract class BaseCommandController extends AbstractController {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initApplicationContext() {
|
||||
if (this.validators != null) {
|
||||
for (int i = 0; i < this.validators.length; i++) {
|
||||
@@ -567,6 +568,7 @@ public abstract class BaseCommandController extends AbstractController {
|
||||
* @deprecated as of Spring 2.0.4, in favor of the
|
||||
* {@link #suppressValidation(HttpServletRequest, Object)} variant
|
||||
*/
|
||||
@Deprecated
|
||||
protected boolean suppressValidation(HttpServletRequest request) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -108,6 +108,7 @@ public class CancellableFormController extends SimpleFormController {
|
||||
* Consider an explicit cancel request as a form submission too.
|
||||
* @see #isCancelRequest(javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
@Override
|
||||
protected boolean isFormSubmission(HttpServletRequest request) {
|
||||
return super.isFormSubmission(request) || isCancelRequest(request);
|
||||
}
|
||||
@@ -116,6 +117,7 @@ public class CancellableFormController extends SimpleFormController {
|
||||
* Suppress validation for an explicit cancel request too.
|
||||
* @see #isCancelRequest(javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
@Override
|
||||
protected boolean suppressValidation(HttpServletRequest request, Object command) {
|
||||
return super.suppressValidation(request, command) || isCancelRequest(request);
|
||||
}
|
||||
@@ -129,6 +131,7 @@ public class CancellableFormController extends SimpleFormController {
|
||||
* @see #onCancel(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, Object)
|
||||
* @see SimpleFormController#processFormSubmission
|
||||
*/
|
||||
@Override
|
||||
protected ModelAndView processFormSubmission(
|
||||
HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
|
||||
throws Exception {
|
||||
|
||||
@@ -84,6 +84,7 @@ public class ParameterizableViewController extends AbstractController {
|
||||
return this.viewName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initApplicationContext() {
|
||||
if (this.viewName == null) {
|
||||
throw new IllegalArgumentException("Property 'viewName' is required");
|
||||
@@ -95,6 +96,7 @@ public class ParameterizableViewController extends AbstractController {
|
||||
* Return a ModelAndView object with the specified view name.
|
||||
* @see #getViewName()
|
||||
*/
|
||||
@Override
|
||||
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@ public class ServletForwardingController extends AbstractController implements B
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ public class ServletWrappingController extends AbstractController
|
||||
* Invoke the the wrapped Servlet instance.
|
||||
* @see javax.servlet.Servlet#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
|
||||
*/
|
||||
@Override
|
||||
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
|
||||
|
||||
@@ -168,6 +168,7 @@ public class SimpleFormController extends AbstractFormController {
|
||||
* @see #setFormView
|
||||
* @see #showForm(HttpServletRequest, HttpServletResponse, BindException, Map)
|
||||
*/
|
||||
@Override
|
||||
protected ModelAndView showForm(
|
||||
HttpServletRequest request, HttpServletResponse response, BindException errors)
|
||||
throws Exception {
|
||||
@@ -210,6 +211,7 @@ public class SimpleFormController extends AbstractFormController {
|
||||
* @throws Exception in case of invalid state or arguments
|
||||
* @see ModelAndView
|
||||
*/
|
||||
@Override
|
||||
protected Map referenceData(HttpServletRequest request, Object command, Errors errors) throws Exception {
|
||||
return referenceData(request);
|
||||
}
|
||||
@@ -247,6 +249,7 @@ public class SimpleFormController extends AbstractFormController {
|
||||
* @see #onSubmit(Object)
|
||||
* @see #doSubmitAction(Object)
|
||||
*/
|
||||
@Override
|
||||
protected ModelAndView processFormSubmission(
|
||||
HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
|
||||
throws Exception {
|
||||
@@ -274,6 +277,7 @@ public class SimpleFormController extends AbstractFormController {
|
||||
* validated but just show the new form.
|
||||
* @see #isFormChangeRequest
|
||||
*/
|
||||
@Override
|
||||
protected boolean suppressValidation(HttpServletRequest request, Object command) {
|
||||
return isFormChangeRequest(request, command);
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@ public class UrlFilenameViewController extends AbstractUrlViewController {
|
||||
* @see #setPrefix
|
||||
* @see #setSuffix
|
||||
*/
|
||||
@Override
|
||||
protected String getViewNameForRequest(HttpServletRequest request) {
|
||||
String uri = extractOperableUrl(request);
|
||||
return getViewNameForUrlPath(uri);
|
||||
|
||||
@@ -666,12 +666,14 @@ public class AnnotationMethodHandlerAdapter extends WebContentGenerator implemen
|
||||
|
||||
public String[] params = new String[0];
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
RequestMappingInfo other = (RequestMappingInfo) obj;
|
||||
return (Arrays.equals(this.paths, other.paths) && Arrays.equals(this.methods, other.methods) &&
|
||||
Arrays.equals(this.params, other.params));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (Arrays.hashCode(this.paths) * 29 + Arrays.hashCode(this.methods) * 31 +
|
||||
Arrays.hashCode(this.params));
|
||||
|
||||
@@ -105,6 +105,7 @@ public class DefaultAnnotationHandlerMapping extends AbstractDetectingUrlHandler
|
||||
* Checks for presence of the {@link org.springframework.web.bind.annotation.RequestMapping}
|
||||
* annotation on the handler class and on any of its methods.
|
||||
*/
|
||||
@Override
|
||||
protected String[] determineUrlsForHandler(String beanName) {
|
||||
ApplicationContext context = getApplicationContext();
|
||||
Class<?> handlerType = context.getType(beanName);
|
||||
@@ -177,6 +178,7 @@ public class DefaultAnnotationHandlerMapping extends AbstractDetectingUrlHandler
|
||||
* Validate the given annotated handler against the current request.
|
||||
* @see #validateMapping
|
||||
*/
|
||||
@Override
|
||||
protected void validateHandler(Object handler, HttpServletRequest request) throws Exception {
|
||||
RequestMapping mapping = this.cachedMappings.get(handler.getClass());
|
||||
if (mapping == null) {
|
||||
|
||||
@@ -84,6 +84,7 @@ public class InternalPathMethodNameResolver extends AbstractUrlMethodNameResolve
|
||||
* @see #extractHandlerMethodNameFromUrlPath
|
||||
* @see #postProcessHandlerMethodName
|
||||
*/
|
||||
@Override
|
||||
protected String getHandlerMethodNameForUrlPath(String urlPath) {
|
||||
String methodName = (String) this.methodNameCache.get(urlPath);
|
||||
if (methodName == null) {
|
||||
|
||||
@@ -403,6 +403,7 @@ public class MultiActionController extends AbstractController implements LastMod
|
||||
* @see #invokeNamedMethod
|
||||
* @see #handleNoSuchRequestHandlingMethod
|
||||
*/
|
||||
@Override
|
||||
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
try {
|
||||
@@ -601,6 +602,7 @@ public class MultiActionController extends AbstractController implements LastMod
|
||||
* @deprecated as of Spring 2.0:
|
||||
* use <code>initBinder(HttpServletRequest, ServletRequestDataBinder)</code> instead
|
||||
*/
|
||||
@Deprecated
|
||||
protected void initBinder(ServletRequest request, ServletRequestDataBinder binder) throws Exception {
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ public class PropertiesMethodNameResolver extends AbstractUrlMethodNameResolver
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String getHandlerMethodNameForUrlPath(String urlPath) {
|
||||
String methodName = this.mappings.getProperty(urlPath);
|
||||
if (methodName != null) {
|
||||
|
||||
@@ -106,6 +106,7 @@ public abstract class AbstractControllerUrlHandlerMapping extends AbstractDetect
|
||||
* This implementation delegates to {@link #buildUrlsForHandler},
|
||||
* provided that {@link #isEligibleForMapping} returns <code>true</code>.
|
||||
*/
|
||||
@Override
|
||||
protected String[] determineUrlsForHandler(String beanName) {
|
||||
Class beanClass = getApplicationContext().getType(beanName);
|
||||
if (isEligibleForMapping(beanName, beanClass)) {
|
||||
|
||||
@@ -28,11 +28,13 @@ import org.springframework.stereotype.Controller;
|
||||
*/
|
||||
class AnnotationControllerTypePredicate extends ControllerTypePredicate {
|
||||
|
||||
@Override
|
||||
public boolean isControllerType(Class beanClass) {
|
||||
return (super.isControllerType(beanClass) ||
|
||||
AnnotationUtils.findAnnotation(beanClass, Controller.class) != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMultiActionControllerType(Class beanClass) {
|
||||
return (super.isMultiActionControllerType(beanClass) ||
|
||||
AnnotationUtils.findAnnotation(beanClass, Controller.class) != null);
|
||||
|
||||
@@ -65,6 +65,7 @@ public class ControllerBeanNameHandlerMapping extends AbstractControllerUrlHandl
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String[] buildUrlsForHandler(String beanName, Class beanClass) {
|
||||
List urls = new ArrayList();
|
||||
urls.add(generatePathMapping(beanName));
|
||||
|
||||
@@ -123,6 +123,7 @@ public class ControllerClassNameHandlerMapping extends AbstractControllerUrlHand
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String[] buildUrlsForHandler(String beanName, Class beanClass) {
|
||||
return generatePathMappings(beanClass);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
* @deprecated as of Spring 2.5, in favor of annotation-based controllers.
|
||||
* To be removed in Spring 3.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface ThrowawayController {
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
* @deprecated as of Spring 2.5, in favor of annotation-based controllers.
|
||||
* To be removed in Spring 3.0.
|
||||
*/
|
||||
@Deprecated
|
||||
public class ThrowawayControllerHandlerAdapter implements HandlerAdapter {
|
||||
|
||||
public static final String DEFAULT_COMMAND_NAME = "throwawayController";
|
||||
|
||||
@@ -323,6 +323,7 @@ public class BindStatus {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer("BindStatus: ");
|
||||
sb.append("expression=[").append(this.expression).append("]; ");
|
||||
|
||||
@@ -90,6 +90,7 @@ public class JspAwareRequestContext extends RequestContext {
|
||||
* in page, request, session or application scope; if not found,
|
||||
* returns the <code>HttpServletRequest.getLocale()</code>.
|
||||
*/
|
||||
@Override
|
||||
protected Locale getFallbackLocale() {
|
||||
if (jstlPresent) {
|
||||
Locale locale = JstlPageLocaleResolver.getJstlLocale(getPageContext());
|
||||
|
||||
@@ -117,6 +117,7 @@ public abstract class JstlUtils {
|
||||
this.request = request;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceBundle getResourceBundle() {
|
||||
HttpSession session = this.request.getSession(false);
|
||||
if (session != null) {
|
||||
@@ -129,6 +130,7 @@ public abstract class JstlUtils {
|
||||
return new MessageSourceResourceBundle(this.messageSource, getLocale());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Locale getLocale() {
|
||||
HttpSession session = this.request.getSession(false);
|
||||
if (session != null) {
|
||||
|
||||
@@ -58,6 +58,7 @@ public class BindErrorsTag extends HtmlEscapingAwareTag {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected final int doStartTagInternal() throws ServletException, JspException {
|
||||
String resolvedName = ExpressionEvaluationUtils.evaluateString("name", this.name, pageContext);
|
||||
this.errors = getRequestContext().getErrors(resolvedName, isHtmlEscape());
|
||||
@@ -71,6 +72,7 @@ public class BindErrorsTag extends HtmlEscapingAwareTag {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int doEndTag() {
|
||||
this.pageContext.removeAttribute(ERRORS_VARIABLE_NAME, PageContext.REQUEST_SCOPE);
|
||||
return EVAL_PAGE;
|
||||
@@ -85,6 +87,7 @@ public class BindErrorsTag extends HtmlEscapingAwareTag {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void doFinally() {
|
||||
super.doFinally();
|
||||
this.errors = null;
|
||||
|
||||
@@ -101,6 +101,7 @@ public class BindTag extends HtmlEscapingAwareTag implements EditorAwareTag {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected final int doStartTagInternal() throws Exception {
|
||||
String resolvedPath = ExpressionEvaluationUtils.evaluateString("path", getPath(), pageContext);
|
||||
|
||||
@@ -133,6 +134,7 @@ public class BindTag extends HtmlEscapingAwareTag implements EditorAwareTag {
|
||||
return EVAL_BODY_INCLUDE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int doEndTag() {
|
||||
// Reset previous status values.
|
||||
if (this.previousPageStatus != null) {
|
||||
@@ -173,6 +175,7 @@ public class BindTag extends HtmlEscapingAwareTag implements EditorAwareTag {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void doFinally() {
|
||||
super.doFinally();
|
||||
this.status = null;
|
||||
|
||||
@@ -60,6 +60,7 @@ public class EscapeBodyTag extends HtmlEscapingAwareTag implements BodyTag {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int doStartTagInternal() {
|
||||
// do nothing
|
||||
return EVAL_BODY_BUFFERED;
|
||||
@@ -73,6 +74,7 @@ public class EscapeBodyTag extends HtmlEscapingAwareTag implements BodyTag {
|
||||
this.bodyContent = bodyContent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int doAfterBody() throws JspException {
|
||||
try {
|
||||
String content = readBodyContent();
|
||||
|
||||
@@ -45,6 +45,7 @@ public class HtmlEscapeTag extends RequestContextAwareTag {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int doStartTagInternal() throws JspException {
|
||||
boolean resolvedDefaultHtmlEscape =
|
||||
ExpressionEvaluationUtils.evaluateBoolean("defaultHtmlEscape", this.defaultHtmlEscape, pageContext);
|
||||
|
||||
@@ -158,6 +158,7 @@ public class MessageTag extends HtmlEscapingAwareTag {
|
||||
* @see org.springframework.web.util.JavaScriptUtils#javaScriptEscape(String)
|
||||
* @see #writeMessage(String)
|
||||
*/
|
||||
@Override
|
||||
protected final int doStartTagInternal() throws JspException, IOException {
|
||||
try {
|
||||
// Resolve the unescaped message.
|
||||
|
||||
@@ -78,6 +78,7 @@ public class NestedPathTag extends TagSupport implements TryCatchFinally {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int doStartTag() throws JspException {
|
||||
String resolvedPath = ExpressionEvaluationUtils.evaluateString("path", getPath(), pageContext);
|
||||
|
||||
@@ -95,6 +96,7 @@ public class NestedPathTag extends TagSupport implements TryCatchFinally {
|
||||
/**
|
||||
* Reset any previous nestedPath value.
|
||||
*/
|
||||
@Override
|
||||
public int doEndTag() {
|
||||
if (this.previousNestedPath != null) {
|
||||
// Expose previous nestedPath value.
|
||||
|
||||
@@ -67,6 +67,7 @@ public abstract class RequestContextAwareTag extends TagSupport implements TryCa
|
||||
* @see #REQUEST_CONTEXT_PAGE_ATTRIBUTE
|
||||
* @see org.springframework.web.servlet.support.JspAwareRequestContext
|
||||
*/
|
||||
@Override
|
||||
public final int doStartTag() throws JspException {
|
||||
this.requestContext = (RequestContext) this.pageContext.getAttribute(REQUEST_CONTEXT_PAGE_ATTRIBUTE);
|
||||
try {
|
||||
|
||||
@@ -45,6 +45,7 @@ public class ThemeTag extends MessageTag {
|
||||
/**
|
||||
* Use the theme MessageSource for theme message resolution.
|
||||
*/
|
||||
@Override
|
||||
protected MessageSource getMessageSource() {
|
||||
return getRequestContext().getTheme().getMessageSource();
|
||||
}
|
||||
@@ -52,6 +53,7 @@ public class ThemeTag extends MessageTag {
|
||||
/**
|
||||
* Return exception message that indicates the current theme.
|
||||
*/
|
||||
@Override
|
||||
protected String getNoSuchMessageExceptionDescription(NoSuchMessageException ex) {
|
||||
return "Theme '" + getRequestContext().getTheme().getName() + "': " + ex.getMessage();
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ public class TransformTag extends HtmlEscapingAwareTag {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected final int doStartTagInternal() throws JspException {
|
||||
Object resolvedValue = this.value;
|
||||
if (this.value instanceof String) {
|
||||
|
||||
@@ -76,6 +76,7 @@ public abstract class AbstractCheckedElementTag extends AbstractHtmlInputElement
|
||||
/**
|
||||
* Return a unique ID for the bound name within the current PageContext.
|
||||
*/
|
||||
@Override
|
||||
protected String autogenerateId() throws JspException {
|
||||
return TagIdGenerator.nextId(getName(), this.pageContext);
|
||||
}
|
||||
@@ -86,6 +87,7 @@ public abstract class AbstractCheckedElementTag extends AbstractHtmlInputElement
|
||||
* {@link org.springframework.web.servlet.tags.form.TagWriter},
|
||||
* marking it as 'checked' if appropriate.
|
||||
*/
|
||||
@Override
|
||||
protected abstract int writeTagContent(TagWriter tagWriter) throws JspException;
|
||||
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public abstract class AbstractDataBoundFormElementTag extends AbstractFormTag im
|
||||
* command object name is exposed.
|
||||
* @deprecated as of Spring 2.5, in favor of {@link FormTag#MODEL_ATTRIBUTE_VARIABLE_NAME}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String COMMAND_NAME_VARIABLE_NAME =
|
||||
Conventions.getQualifiedAttributeName(AbstractFormTag.class, "commandName");
|
||||
|
||||
@@ -95,6 +96,7 @@ public abstract class AbstractDataBoundFormElementTag extends AbstractFormTag im
|
||||
* <p>May be a runtime expression; defaults to the value of {@link #getName()}.
|
||||
* Note that the default value may not be valid for certain tags.
|
||||
*/
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
@@ -102,6 +104,7 @@ public abstract class AbstractDataBoundFormElementTag extends AbstractFormTag im
|
||||
/**
|
||||
* Get the value of the '<code>id</code>' attribute.
|
||||
*/
|
||||
@Override
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
@@ -219,6 +222,7 @@ public abstract class AbstractDataBoundFormElementTag extends AbstractFormTag im
|
||||
/**
|
||||
* Disposes of the {@link BindStatus} instance.
|
||||
*/
|
||||
@Override
|
||||
public void doFinally() {
|
||||
super.doFinally();
|
||||
this.bindStatus = null;
|
||||
|
||||
@@ -86,6 +86,7 @@ public abstract class AbstractFormTag extends HtmlEscapingAwareTag {
|
||||
* the created {@link TagWriter} to the {@link #writeTagContent(TagWriter)} method.
|
||||
* @return the value returned by {@link #writeTagContent(TagWriter)}
|
||||
*/
|
||||
@Override
|
||||
protected final int doStartTagInternal() throws Exception {
|
||||
return writeTagContent(createTagWriter());
|
||||
}
|
||||
@@ -111,6 +112,7 @@ public abstract class AbstractFormTag extends HtmlEscapingAwareTag {
|
||||
/**
|
||||
* Overridden to default to <code>true</code> in case of no explicit default given.
|
||||
*/
|
||||
@Override
|
||||
protected boolean isDefaultHtmlEscape() {
|
||||
Boolean defaultHtmlEscape = getRequestContext().getDefaultHtmlEscape();
|
||||
return (defaultHtmlEscape == null || defaultHtmlEscape.booleanValue());
|
||||
|
||||
@@ -40,6 +40,7 @@ public abstract class AbstractHtmlElementBodyTag extends AbstractHtmlElementTag
|
||||
private TagWriter tagWriter;
|
||||
|
||||
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
onWriteTagContent();
|
||||
this.tagWriter = tagWriter;
|
||||
@@ -58,6 +59,7 @@ public abstract class AbstractHtmlElementBodyTag extends AbstractHtmlElementTag
|
||||
* {@link #renderDefaultContent render the default content}.
|
||||
* @return Tag#EVAL_PAGE
|
||||
*/
|
||||
@Override
|
||||
public int doEndTag() throws JspException {
|
||||
if (shouldRender()) {
|
||||
if (this.bodyContent != null && StringUtils.hasText(this.bodyContent.getString())) {
|
||||
@@ -83,6 +85,7 @@ public abstract class AbstractHtmlElementBodyTag extends AbstractHtmlElementTag
|
||||
/**
|
||||
* Clean up any attributes and stored resources.
|
||||
*/
|
||||
@Override
|
||||
public void doFinally() {
|
||||
super.doFinally();
|
||||
removeAttributes();
|
||||
|
||||
@@ -375,6 +375,7 @@ public abstract class AbstractHtmlElementTag extends AbstractDataBoundFormElemen
|
||||
* Writes the default attributes configured via this base class to the supplied {@link TagWriter}.
|
||||
* Subclasses should call this when they want the base attribute set to be written to the output.
|
||||
*/
|
||||
@Override
|
||||
protected void writeDefaultAttributes(TagWriter tagWriter) throws JspException {
|
||||
super.writeDefaultAttributes(tagWriter);
|
||||
writeOptionalAttributes(tagWriter);
|
||||
|
||||
@@ -172,6 +172,7 @@ public abstract class AbstractHtmlInputElementTag extends AbstractHtmlElementTag
|
||||
/**
|
||||
* Adds input-specific optional attributes as defined by this base class.
|
||||
*/
|
||||
@Override
|
||||
protected void writeOptionalAttributes(TagWriter tagWriter) throws JspException {
|
||||
super.writeOptionalAttributes(tagWriter);
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@ public abstract class AbstractMultiCheckedElementTag extends AbstractCheckedElem
|
||||
* Appends a counter to a specified id as well,
|
||||
* since we're dealing with multiple HTML elements.
|
||||
*/
|
||||
@Override
|
||||
protected String resolveId() throws JspException {
|
||||
Object id = evaluate("id", getId());
|
||||
if (id != null) {
|
||||
@@ -178,6 +179,7 @@ public abstract class AbstractMultiCheckedElementTag extends AbstractCheckedElem
|
||||
* {@link #setItems(Object)} values. Marks the element as checked if the
|
||||
* value matches the bound value.
|
||||
*/
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
Object items = getItems();
|
||||
Object itemsObject = (items instanceof String ? evaluate("items", (String) items) : items);
|
||||
|
||||
@@ -76,6 +76,7 @@ public abstract class AbstractSingleCheckedElementTag extends AbstractCheckedEle
|
||||
* {@link #setValue(Object) value}. Marks the element as checked if the
|
||||
* value matches the {@link #getValue bound value}.
|
||||
*/
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
tagWriter.startTag("input");
|
||||
String id = resolveId();
|
||||
|
||||
@@ -47,6 +47,7 @@ import org.springframework.web.bind.WebDataBinder;
|
||||
*/
|
||||
public class CheckboxTag extends AbstractSingleCheckedElementTag {
|
||||
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
super.writeTagContent(tagWriter);
|
||||
|
||||
@@ -62,6 +63,7 @@ public class CheckboxTag extends AbstractSingleCheckedElementTag {
|
||||
return SKIP_BODY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeTagDetails(TagWriter tagWriter) throws JspException {
|
||||
tagWriter.writeAttribute("type", "checkbox");
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.springframework.web.bind.WebDataBinder;
|
||||
*/
|
||||
public class CheckboxesTag extends AbstractMultiCheckedElementTag {
|
||||
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
super.writeTagContent(tagWriter);
|
||||
|
||||
@@ -48,6 +49,7 @@ public class CheckboxesTag extends AbstractMultiCheckedElementTag {
|
||||
return SKIP_BODY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getInputType() {
|
||||
return "checkbox";
|
||||
}
|
||||
|
||||
@@ -106,6 +106,7 @@ public class ErrorsTag extends AbstractHtmlElementBodyTag implements BodyTag {
|
||||
* <p>Simply returns <code>null</code> because the '<code>name</code>' attribute
|
||||
* is not a validate attribute for the '<code>span</code>' element.
|
||||
*/
|
||||
@Override
|
||||
protected String getName() throws JspException {
|
||||
return null;
|
||||
}
|
||||
@@ -118,6 +119,7 @@ public class ErrorsTag extends AbstractHtmlElementBodyTag implements BodyTag {
|
||||
* @return the value for the HTML '<code>id</code>' attribute
|
||||
* @see #getPropertyPath()
|
||||
*/
|
||||
@Override
|
||||
protected String autogenerateId() throws JspException {
|
||||
String path = getPropertyPath();
|
||||
if ("".equals(path)) {
|
||||
@@ -132,6 +134,7 @@ public class ErrorsTag extends AbstractHtmlElementBodyTag implements BodyTag {
|
||||
* <p>Only renders output when there are errors for the configured {@link #setPath path}.
|
||||
* @return <code>true</code> only when there are errors for the configured {@link #setPath path}
|
||||
*/
|
||||
@Override
|
||||
protected boolean shouldRender() throws JspException {
|
||||
try {
|
||||
return getBindStatus().isError();
|
||||
@@ -142,6 +145,7 @@ public class ErrorsTag extends AbstractHtmlElementBodyTag implements BodyTag {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderDefaultContent(TagWriter tagWriter) throws JspException {
|
||||
tagWriter.startTag(getElement());
|
||||
writeDefaultAttributes(tagWriter);
|
||||
@@ -163,6 +167,7 @@ public class ErrorsTag extends AbstractHtmlElementBodyTag implements BodyTag {
|
||||
* <p>Only called if {@link #shouldRender()} returns <code>true</code>.
|
||||
* @see #removeAttributes()
|
||||
*/
|
||||
@Override
|
||||
protected void exposeAttributes() throws JspException {
|
||||
List errorMessages = new ArrayList();
|
||||
errorMessages.addAll(Arrays.asList(getBindStatus().getErrorMessages()));
|
||||
@@ -176,6 +181,7 @@ public class ErrorsTag extends AbstractHtmlElementBodyTag implements BodyTag {
|
||||
* {@link #MESSAGES_ATTRIBUTE this key} in the {@link PageContext#PAGE_SCOPE}.
|
||||
* @see #exposeAttributes()
|
||||
*/
|
||||
@Override
|
||||
protected void removeAttributes() {
|
||||
if (this.errorMessagesWereExposed) {
|
||||
if (this.oldMessages != null) {
|
||||
|
||||
@@ -153,6 +153,7 @@ public class FormTag extends AbstractHtmlElementTag {
|
||||
/**
|
||||
* Get the value of the '<code>name</code>' attribute.
|
||||
*/
|
||||
@Override
|
||||
protected String getName() throws JspException {
|
||||
return this.name;
|
||||
}
|
||||
@@ -285,6 +286,7 @@ public class FormTag extends AbstractHtmlElementTag {
|
||||
* @param tagWriter the {@link TagWriter} to which the form content is to be written
|
||||
* @return {@link javax.servlet.jsp.tagext.Tag#EVAL_BODY_INCLUDE}
|
||||
*/
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
this.tagWriter = tagWriter;
|
||||
|
||||
@@ -319,6 +321,7 @@ public class FormTag extends AbstractHtmlElementTag {
|
||||
/**
|
||||
* Autogenerated IDs correspond to the form object name.
|
||||
*/
|
||||
@Override
|
||||
protected String autogenerateId() throws JspException {
|
||||
return resolveModelAttribute();
|
||||
}
|
||||
@@ -373,6 +376,7 @@ public class FormTag extends AbstractHtmlElementTag {
|
||||
* Closes the '<code>form</code>' block tag and removes the form object name
|
||||
* from the {@link javax.servlet.jsp.PageContext}.
|
||||
*/
|
||||
@Override
|
||||
public int doEndTag() throws JspException {
|
||||
this.tagWriter.endTag();
|
||||
this.pageContext.removeAttribute(MODEL_ATTRIBUTE_VARIABLE_NAME, PageContext.REQUEST_SCOPE);
|
||||
@@ -391,6 +395,7 @@ public class FormTag extends AbstractHtmlElementTag {
|
||||
/**
|
||||
* Clears the stored {@link TagWriter}.
|
||||
*/
|
||||
@Override
|
||||
public void doFinally() {
|
||||
super.doFinally();
|
||||
this.tagWriter = null;
|
||||
@@ -401,6 +406,7 @@ public class FormTag extends AbstractHtmlElementTag {
|
||||
/**
|
||||
* Override resolve CSS class since error class is not supported.
|
||||
*/
|
||||
@Override
|
||||
protected String resolveCssClass() throws JspException {
|
||||
return ObjectUtils.getDisplayString(evaluate("cssClass", getCssClass()));
|
||||
}
|
||||
@@ -409,6 +415,7 @@ public class FormTag extends AbstractHtmlElementTag {
|
||||
* Unsupported for forms.
|
||||
* @throws UnsupportedOperationException always
|
||||
*/
|
||||
@Override
|
||||
public void setPath(String path) {
|
||||
throw new UnsupportedOperationException("The 'path' attribute is not supported for forms");
|
||||
}
|
||||
@@ -417,6 +424,7 @@ public class FormTag extends AbstractHtmlElementTag {
|
||||
* Unsupported for forms.
|
||||
* @throws UnsupportedOperationException always
|
||||
*/
|
||||
@Override
|
||||
public void setCssErrorClass(String cssErrorClass) {
|
||||
throw new UnsupportedOperationException("The 'cssErrorClass' attribute is not supported for forms");
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public class HiddenInputTag extends AbstractDataBoundFormElementTag {
|
||||
* @see #writeDefaultAttributes(TagWriter)
|
||||
* @see #getBoundValue()
|
||||
*/
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
tagWriter.startTag("input");
|
||||
writeDefaultAttributes(tagWriter);
|
||||
|
||||
@@ -133,6 +133,7 @@ public class InputTag extends AbstractHtmlInputElementTag {
|
||||
* Uses the value returned by {@link #getType()} to determine which
|
||||
* type of '<code>input</code>' element to render.
|
||||
*/
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
tagWriter.startTag("input");
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ public class LabelTag extends AbstractHtmlElementTag {
|
||||
* that body content is written correctly.
|
||||
* @return {@link javax.servlet.jsp.tagext.Tag#EVAL_BODY_INCLUDE}
|
||||
*/
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
tagWriter.startTag(LABEL_TAG);
|
||||
tagWriter.writeAttribute(FOR_ATTRIBUTE, resolveFor());
|
||||
@@ -98,6 +99,7 @@ public class LabelTag extends AbstractHtmlElementTag {
|
||||
* '<code>label</code>' tag.
|
||||
* @return the value for the HTML '<code>name</code>' attribute
|
||||
*/
|
||||
@Override
|
||||
protected String getName() throws JspException {
|
||||
// This also suppresses the 'id' attribute (which is okay for a <label/>)
|
||||
return null;
|
||||
@@ -130,6 +132,7 @@ public class LabelTag extends AbstractHtmlElementTag {
|
||||
/**
|
||||
* Close the '<code>label</code>' tag.
|
||||
*/
|
||||
@Override
|
||||
public int doEndTag() throws JspException {
|
||||
this.tagWriter.endTag();
|
||||
return EVAL_PAGE;
|
||||
@@ -138,6 +141,7 @@ public class LabelTag extends AbstractHtmlElementTag {
|
||||
/**
|
||||
* Disposes of the {@link TagWriter} instance.
|
||||
*/
|
||||
@Override
|
||||
public void doFinally() {
|
||||
super.doFinally();
|
||||
this.tagWriter = null;
|
||||
|
||||
@@ -147,12 +147,14 @@ public class OptionTag extends AbstractHtmlElementBodyTag implements BodyTag {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void renderDefaultContent(TagWriter tagWriter) throws JspException {
|
||||
Object value = this.pageContext.getAttribute(VALUE_VARIABLE_NAME);
|
||||
String label = getLabelValue(value);
|
||||
renderOption(value, label, tagWriter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderFromBodyContent(BodyContent bodyContent, TagWriter tagWriter) throws JspException {
|
||||
Object value = this.pageContext.getAttribute(VALUE_VARIABLE_NAME);
|
||||
String label = bodyContent.getString();
|
||||
@@ -162,10 +164,12 @@ public class OptionTag extends AbstractHtmlElementBodyTag implements BodyTag {
|
||||
/**
|
||||
* Make sure we are under a '<code>select</code>' tag before proceeding.
|
||||
*/
|
||||
@Override
|
||||
protected void onWriteTagContent() {
|
||||
assertUnderSelectTag();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void exposeAttributes() throws JspException {
|
||||
Object value = resolveValue();
|
||||
this.oldValue = this.pageContext.getAttribute(VALUE_VARIABLE_NAME);
|
||||
@@ -174,10 +178,12 @@ public class OptionTag extends AbstractHtmlElementBodyTag implements BodyTag {
|
||||
this.pageContext.setAttribute(DISPLAY_VALUE_VARIABLE_NAME, getDisplayString(value, getBindStatus().getEditor()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BindStatus getBindStatus() {
|
||||
return (BindStatus) this.pageContext.getAttribute(SelectTag.LIST_VALUE_PAGE_ATTRIBUTE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void removeAttributes() {
|
||||
if (this.oldValue != null) {
|
||||
this.pageContext.setAttribute(VALUE_ATTRIBUTE, this.oldValue);
|
||||
@@ -212,6 +218,7 @@ public class OptionTag extends AbstractHtmlElementBodyTag implements BodyTag {
|
||||
tagWriter.endTag();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String autogenerateId() throws JspException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -142,6 +142,7 @@ public class OptionsTag extends AbstractHtmlElementTag {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
assertUnderSelectTag();
|
||||
Object items = getItems();
|
||||
@@ -163,6 +164,7 @@ public class OptionsTag extends AbstractHtmlElementTag {
|
||||
* Appends a counter to a specified id,
|
||||
* since we're dealing with multiple HTML elements.
|
||||
*/
|
||||
@Override
|
||||
protected String resolveId() throws JspException {
|
||||
Object id = evaluate("id", getId());
|
||||
if (id != null) {
|
||||
@@ -176,6 +178,7 @@ public class OptionsTag extends AbstractHtmlElementTag {
|
||||
TagUtils.assertHasAncestorOfType(this, SelectTag.class, "options", "select");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BindStatus getBindStatus() {
|
||||
return (BindStatus) this.pageContext.getAttribute(SelectTag.LIST_VALUE_PAGE_ATTRIBUTE);
|
||||
}
|
||||
@@ -190,10 +193,12 @@ public class OptionsTag extends AbstractHtmlElementTag {
|
||||
super(optionSource, getBindStatus(), valueProperty, labelProperty, isHtmlEscape());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isOptionDisabled() {
|
||||
return isDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeCommonAttributes(TagWriter tagWriter) throws JspException {
|
||||
writeOptionalAttribute(tagWriter, "id", resolveId());
|
||||
writeOptionalAttributes(tagWriter);
|
||||
|
||||
@@ -51,6 +51,7 @@ public class PasswordInputTag extends InputTag {
|
||||
* Return '<code>password</code>' causing the rendered HTML '<code>input</code>'
|
||||
* element to have a '<code>type</code>' of '<code>password</code>'.
|
||||
*/
|
||||
@Override
|
||||
protected String getType() {
|
||||
return "password";
|
||||
}
|
||||
@@ -60,6 +61,7 @@ public class PasswordInputTag extends InputTag {
|
||||
* {@link #setShowPassword(boolean) 'showPassword'} property value is
|
||||
* {@link Boolean#TRUE true}.
|
||||
*/
|
||||
@Override
|
||||
protected void writeValue(TagWriter tagWriter) throws JspException {
|
||||
if (this.showPassword) {
|
||||
super.writeValue(tagWriter);
|
||||
|
||||
@@ -34,6 +34,7 @@ import javax.servlet.jsp.JspException;
|
||||
*/
|
||||
public class RadioButtonTag extends AbstractSingleCheckedElementTag {
|
||||
|
||||
@Override
|
||||
protected void writeTagDetails(TagWriter tagWriter) throws JspException {
|
||||
tagWriter.writeAttribute("type", "radio");
|
||||
Object resolvedValue = evaluate("value", getValue());
|
||||
|
||||
@@ -29,6 +29,7 @@ package org.springframework.web.servlet.tags.form;
|
||||
*/
|
||||
public class RadioButtonsTag extends AbstractMultiCheckedElementTag {
|
||||
|
||||
@Override
|
||||
protected String getInputType() {
|
||||
return "radio";
|
||||
}
|
||||
|
||||
@@ -193,6 +193,7 @@ public class SelectTag extends AbstractHtmlInputElementTag {
|
||||
* {@link #setItems items} property is set, otherwise exposes the
|
||||
* bound value for the nested {@link OptionTag OptionTags}.
|
||||
*/
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
tagWriter.startTag("select");
|
||||
writeDefaultAttributes(tagWriter);
|
||||
@@ -287,6 +288,7 @@ public class SelectTag extends AbstractHtmlInputElementTag {
|
||||
* Closes any block tag that might have been opened when using
|
||||
* nested {@link OptionTag options}.
|
||||
*/
|
||||
@Override
|
||||
public int doEndTag() throws JspException {
|
||||
if (this.tagWriter != null) {
|
||||
this.tagWriter.endTag();
|
||||
@@ -299,6 +301,7 @@ public class SelectTag extends AbstractHtmlInputElementTag {
|
||||
* Clears the {@link TagWriter} that might have been left over when using
|
||||
* nested {@link OptionTag options}.
|
||||
*/
|
||||
@Override
|
||||
public void doFinally() {
|
||||
super.doFinally();
|
||||
this.tagWriter = null;
|
||||
|
||||
@@ -89,6 +89,7 @@ public class TextareaTag extends AbstractHtmlInputElementTag {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int writeTagContent(TagWriter tagWriter) throws JspException {
|
||||
tagWriter.startTag("textarea");
|
||||
writeDefaultAttributes(tagWriter);
|
||||
|
||||
@@ -59,6 +59,7 @@ public class ThemeChangeInterceptor extends HandlerInterceptorAdapter {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||
throws ServletException {
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ public abstract class AbstractTemplateView extends AbstractUrlBasedView {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected final void renderMergedOutputModel(
|
||||
Map model, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ public class AbstractTemplateViewResolver extends UrlBasedViewResolver {
|
||||
private boolean exposeSpringMacroHelpers = true;
|
||||
|
||||
|
||||
@Override
|
||||
protected Class requiredViewClass() {
|
||||
return AbstractTemplateView.class;
|
||||
}
|
||||
@@ -97,6 +98,7 @@ public class AbstractTemplateViewResolver extends UrlBasedViewResolver {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
|
||||
AbstractTemplateView view = (AbstractTemplateView) super.buildView(viewName);
|
||||
view.setExposeRequestAttributes(this.exposeRequestAttributes);
|
||||
|
||||
@@ -76,6 +76,7 @@ public abstract class AbstractUrlBasedView extends AbstractView implements Initi
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer(super.toString());
|
||||
sb.append("; URL [").append(getUrl()).append("]");
|
||||
|
||||
@@ -377,6 +377,7 @@ public abstract class AbstractView extends WebApplicationObjectSupport implement
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer(getClass().getName());
|
||||
if (getBeanName() != null) {
|
||||
|
||||
@@ -175,6 +175,7 @@ public class InternalResourceView extends AbstractUrlBasedView {
|
||||
/**
|
||||
* An ApplicationContext is not strictly required for InternalResourceView.
|
||||
*/
|
||||
@Override
|
||||
protected boolean isContextRequired() {
|
||||
return false;
|
||||
}
|
||||
@@ -185,6 +186,7 @@ public class InternalResourceView extends AbstractUrlBasedView {
|
||||
* @see #setExposeForwardAttributes
|
||||
* @see #exposeForwardRequestAttributes(javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
@Override
|
||||
protected void initServletContext(ServletContext sc) {
|
||||
if (this.exposeForwardAttributes == null && sc.getMajorVersion() == 2 && sc.getMinorVersion() < 5) {
|
||||
this.exposeForwardAttributes = Boolean.TRUE;
|
||||
@@ -196,6 +198,7 @@ public class InternalResourceView extends AbstractUrlBasedView {
|
||||
* Render the internal resource given the specified model.
|
||||
* This includes setting the model as request attributes.
|
||||
*/
|
||||
@Override
|
||||
protected void renderMergedOutputModel(
|
||||
Map model, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ public class InternalResourceViewResolver extends UrlBasedViewResolver {
|
||||
/**
|
||||
* This resolver requires {@link InternalResourceView}.
|
||||
*/
|
||||
@Override
|
||||
protected Class requiredViewClass() {
|
||||
return InternalResourceView.class;
|
||||
}
|
||||
@@ -114,6 +115,7 @@ public class InternalResourceViewResolver extends UrlBasedViewResolver {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
|
||||
InternalResourceView view = (InternalResourceView) super.buildView(viewName);
|
||||
if (this.alwaysInclude != null) {
|
||||
|
||||
@@ -114,6 +114,7 @@ public class JstlView extends InternalResourceView {
|
||||
* context-param.
|
||||
* @see JstlUtils#getJstlAwareMessageSource
|
||||
*/
|
||||
@Override
|
||||
protected void initServletContext(ServletContext servletContext) {
|
||||
if (this.messageSource != null) {
|
||||
this.messageSource = JstlUtils.getJstlAwareMessageSource(servletContext, this.messageSource);
|
||||
@@ -125,6 +126,7 @@ public class JstlView extends InternalResourceView {
|
||||
* Exposes a JSTL LocalizationContext for Spring's locale and MessageSource.
|
||||
* @see JstlUtils#exposeLocalizationContext
|
||||
*/
|
||||
@Override
|
||||
protected void exposeHelpers(HttpServletRequest request) throws Exception {
|
||||
if (this.messageSource != null) {
|
||||
JstlUtils.exposeLocalizationContext(request, this.messageSource);
|
||||
|
||||
@@ -189,6 +189,7 @@ public class RedirectView extends AbstractUrlBasedView {
|
||||
* @see #appendQueryProperties
|
||||
* @see #sendRedirect
|
||||
*/
|
||||
@Override
|
||||
protected void renderMergedOutputModel(
|
||||
Map model, HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
|
||||
|
||||
@@ -174,6 +174,7 @@ public class ResourceBundleViewResolver extends AbstractCachingViewResolver impl
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initApplicationContext() throws BeansException {
|
||||
if (this.localesToInitialize != null) {
|
||||
for (int i = 0; i < this.localesToInitialize.length; i++) {
|
||||
@@ -182,6 +183,7 @@ public class ResourceBundleViewResolver extends AbstractCachingViewResolver impl
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected View loadView(String viewName, Locale locale) throws Exception {
|
||||
BeanFactory factory = initFactory(locale);
|
||||
try {
|
||||
|
||||
@@ -333,6 +333,7 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
|
||||
return this.order;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initApplicationContext() {
|
||||
super.initApplicationContext();
|
||||
if (getViewClass() == null) {
|
||||
@@ -345,6 +346,7 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
|
||||
* This implementation returns just the view name,
|
||||
* as this ViewResolver doesn't support localized resolution.
|
||||
*/
|
||||
@Override
|
||||
protected Object getCacheKey(String viewName, Locale locale) {
|
||||
return viewName;
|
||||
}
|
||||
@@ -357,6 +359,7 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
|
||||
* @see #loadView
|
||||
* @see #requiredViewClass
|
||||
*/
|
||||
@Override
|
||||
protected View createView(String viewName, Locale locale) throws Exception {
|
||||
// If this resolver is not supposed to handle the given view,
|
||||
// return null to pass on to the next resolver in the chain.
|
||||
@@ -408,6 +411,7 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext
|
||||
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet
|
||||
*/
|
||||
@Override
|
||||
protected View loadView(String viewName, Locale locale) throws Exception {
|
||||
AbstractUrlBasedView view = buildView(viewName);
|
||||
return (View) getApplicationContext().getAutowireCapableBeanFactory().initializeBean(view, viewName);
|
||||
|
||||
@@ -84,6 +84,7 @@ public class XmlViewResolver extends AbstractCachingViewResolver implements Orde
|
||||
* Pre-initialize the factory from the XML file.
|
||||
* Only effective if caching is enabled.
|
||||
*/
|
||||
@Override
|
||||
protected void initApplicationContext() throws BeansException {
|
||||
if (isCache()) {
|
||||
initFactory();
|
||||
@@ -95,10 +96,12 @@ public class XmlViewResolver extends AbstractCachingViewResolver implements Orde
|
||||
* This implementation returns just the view name,
|
||||
* as XmlViewResolver doesn't support localized resolution.
|
||||
*/
|
||||
@Override
|
||||
protected Object getCacheKey(String viewName, Locale locale) {
|
||||
return viewName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected View loadView(String viewName, Locale locale) throws BeansException {
|
||||
BeanFactory factory = initFactory();
|
||||
try {
|
||||
|
||||
@@ -121,6 +121,7 @@ public abstract class AbstractExcelView extends AbstractView {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean generatesDownloadContent() {
|
||||
return true;
|
||||
}
|
||||
@@ -128,6 +129,7 @@ public abstract class AbstractExcelView extends AbstractView {
|
||||
/**
|
||||
* Renders the Excel view, given the specified model.
|
||||
*/
|
||||
@Override
|
||||
protected final void renderMergedOutputModel(
|
||||
Map model, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ public abstract class AbstractJExcelView extends AbstractView {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean generatesDownloadContent() {
|
||||
return true;
|
||||
}
|
||||
@@ -114,6 +115,7 @@ public abstract class AbstractJExcelView extends AbstractView {
|
||||
/**
|
||||
* Renders the Excel view, given the specified model.
|
||||
*/
|
||||
@Override
|
||||
protected final void renderMergedOutputModel(
|
||||
Map model, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
|
||||
@@ -46,10 +46,12 @@ public abstract class AbstractPdfStamperView extends AbstractUrlBasedView {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean generatesDownloadContent() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void renderMergedOutputModel(
|
||||
Map model, HttpServletRequest request, HttpServletResponse response) throws Exception{
|
||||
|
||||
|
||||
@@ -56,10 +56,12 @@ public abstract class AbstractPdfView extends AbstractView {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean generatesDownloadContent() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void renderMergedOutputModel(
|
||||
Map model, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
|
||||
@@ -119,6 +119,7 @@ public class FreeMarkerConfigurer extends FreeMarkerConfigurationFactory
|
||||
* This implementation registers an additional ClassTemplateLoader
|
||||
* for the Spring-provided macros, added to the end of the list.
|
||||
*/
|
||||
@Override
|
||||
protected void postProcessTemplateLoaders(List templateLoaders) {
|
||||
templateLoaders.add(new ClassTemplateLoader(FreeMarkerConfigurer.class, ""));
|
||||
logger.info("ClassTemplateLoader for Spring macros added to FreeMarker configuration");
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user