diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContext.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContext.java index cf63a425c33..cf33995355d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContext.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,6 +62,7 @@ import org.springframework.web.util.WebUtils; * appropriate fallback for the locale (the HttpServletRequest's primary locale). * * @author Juergen Hoeller + * @author Rossen Stoyanchev * @since 03.03.2003 * @see org.springframework.web.servlet.DispatcherServlet * @see org.springframework.web.servlet.view.AbstractView#setRequestContextAttribute @@ -234,8 +235,10 @@ public class RequestContext { } /** - * Determine the fallback locale for this context.

The default implementation checks for a JSTL locale attribute - * in request, session or application scope; if not found, returns the {@code HttpServletRequest.getLocale()}. + * Determine the fallback locale for this context. + *

The default implementation checks for a JSTL locale attribute in request, + * session or application scope; if not found, returns the + * {@code HttpServletRequest.getLocale()}. * @return the fallback locale (never {@code null}) * @see javax.servlet.http.HttpServletRequest#getLocale() */ @@ -250,8 +253,8 @@ public class RequestContext { } /** - * Determine the fallback theme for this context.

The default implementation returns the default theme (with name - * "theme"). + * Determine the fallback theme for this context. + *

The default implementation returns the default theme (with name "theme"). * @return the fallback theme (never {@code null}) */ protected Theme getFallbackTheme() { @@ -310,8 +313,8 @@ public class RequestContext { } /** - * Return the current theme (never {@code null}).

Resolved lazily for more efficiency when theme support is - * not being used. + * Return the current theme (never {@code null}). + *

Resolved lazily for more efficiency when theme support is not being used. */ public final Theme getTheme() { if (this.theme == null) { @@ -351,7 +354,8 @@ public class RequestContext { /** * Set the UrlPathHelper to use for context path and request URI decoding. Can be used to pass a shared - * UrlPathHelper instance in.

A default UrlPathHelper is always available. + * UrlPathHelper instance in. + *

A default UrlPathHelper is always available. */ public void setUrlPathHelper(UrlPathHelper urlPathHelper) { Assert.notNull(urlPathHelper, "UrlPathHelper must not be null"); @@ -360,7 +364,8 @@ public class RequestContext { /** * Return the UrlPathHelper used for context path and request URI decoding. Can be used to configure the current - * UrlPathHelper.

A default UrlPathHelper is always available. + * UrlPathHelper. + *

A default UrlPathHelper is always available. */ public UrlPathHelper getUrlPathHelper() { return this.urlPathHelper; @@ -377,8 +382,8 @@ public class RequestContext { /** * Return the context path of the original request, that is, the path that indicates the current web application. - * This is useful for building links to other resources within the application.

Delegates to the UrlPathHelper - * for decoding. + * This is useful for building links to other resources within the application. + *

Delegates to the UrlPathHelper for decoding. * @see javax.servlet.http.HttpServletRequest#getContextPath * @see #getUrlPathHelper */ @@ -423,7 +428,7 @@ public class RequestContext { * context path and the servlet path of the original request. This is useful * for building links to other resources within the application where a * servlet mapping of the style {@code "/main/*"} is used. - * Delegates to the UrlPathHelper to determine the context and servlet path. + *

Delegates to the UrlPathHelper to determine the context and servlet path. */ public String getPathToServlet() { String path = this.urlPathHelper.getOriginatingContextPath(this.request); @@ -437,8 +442,8 @@ public class RequestContext { * Return the request URI of the original request, that is, the invoked URL without parameters. This is particularly * useful as HTML form action target, possibly in combination with the original query string.

Note this * implementation will correctly resolve to the URI of any originating root request in the presence of a forwarded - * request. However, this can only work when the Servlet 2.4 'forward' request attributes are present.

Delegates - * to the UrlPathHelper for decoding. + * request. However, this can only work when the Servlet 2.4 'forward' request attributes are present. + *

Delegates to the UrlPathHelper for decoding. * @see #getQueryString * @see org.springframework.web.util.UrlPathHelper#getOriginatingRequestUri * @see #getUrlPathHelper @@ -574,8 +579,9 @@ public class RequestContext { } /** - * Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they - * typically denote theme-specific resource paths and not client-visible messages. + * Retrieve the theme message for the given code. + *

Note that theme messages are never HTML-escaped, as they typically denote + * theme-specific resource paths and not client-visible messages. * @param code code of the message * @param defaultMessage String to return if the lookup fails * @return the message @@ -585,8 +591,9 @@ public class RequestContext { } /** - * Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they - * typically denote theme-specific resource paths and not client-visible messages. + * Retrieve the theme message for the given code. + *

Note that theme messages are never HTML-escaped, as they typically denote + * theme-specific resource paths and not client-visible messages. * @param code code of the message * @param args arguments for the message, or {@code null} if none * @param defaultMessage String to return if the lookup fails @@ -597,8 +604,9 @@ public class RequestContext { } /** - * Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they - * typically denote theme-specific resource paths and not client-visible messages. + * Retrieve the theme message for the given code. + *

Note that theme messages are never HTML-escaped, as they typically denote + * theme-specific resource paths and not client-visible messages. * @param code code of the message * @param args arguments for the message as a List, or {@code null} if none * @param defaultMessage String to return if the lookup fails @@ -610,8 +618,9 @@ public class RequestContext { } /** - * Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they - * typically denote theme-specific resource paths and not client-visible messages. + * Retrieve the theme message for the given code. + *

Note that theme messages are never HTML-escaped, as they typically denote + * theme-specific resource paths and not client-visible messages. * @param code code of the message * @return the message * @throws org.springframework.context.NoSuchMessageException if not found @@ -621,8 +630,9 @@ public class RequestContext { } /** - * Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they - * typically denote theme-specific resource paths and not client-visible messages. + * Retrieve the theme message for the given code. + *

Note that theme messages are never HTML-escaped, as they typically denote + * theme-specific resource paths and not client-visible messages. * @param code code of the message * @param args arguments for the message, or {@code null} if none * @return the message @@ -633,8 +643,9 @@ public class RequestContext { } /** - * Retrieve the theme message for the given code.

Note that theme messages are never HTML-escaped, as they - * typically denote theme-specific resource paths and not client-visible messages. + * Retrieve the theme message for the given code. + *

Note that theme messages are never HTML-escaped, as they typically denote + * theme-specific resource paths and not client-visible messages. * @param code code of the message * @param args arguments for the message as a List, or {@code null} if none * @return the message @@ -645,8 +656,9 @@ public class RequestContext { } /** - * Retrieve the given MessageSourceResolvable in the current theme.

Note that theme messages are never - * HTML-escaped, as they typically denote theme-specific resource paths and not client-visible messages. + * Retrieve the given MessageSourceResolvable in the current theme. + *

Note that theme messages are never HTML-escaped, as they typically denote + * theme-specific resource paths and not client-visible messages. * @param resolvable the MessageSourceResolvable * @return the message * @throws org.springframework.context.NoSuchMessageException if not found diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java index 120b910727f..1af5e3972f5 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java @@ -32,7 +32,6 @@ import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; import org.springframework.web.servlet.support.RequestDataValueProcessor; import org.springframework.web.util.HtmlUtils; -import org.springframework.web.util.UrlPathHelper; /** * Databinding-aware JSP tag for rendering an HTML '{@code form}' whose @@ -51,6 +50,7 @@ import org.springframework.web.util.UrlPathHelper; * @author Rob Harrop * @author Juergen Hoeller * @author Scott Andrews + * @author Rossen Stoyanchev * @since 2.0 * @see org.springframework.web.servlet.mvc.SimpleFormController */ diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/FormTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/FormTagTests.java index c3cd6764afc..3f4247033b5 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/FormTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/FormTagTests.java @@ -34,6 +34,7 @@ import org.springframework.web.servlet.support.RequestDataValueProcessor; * @author Juergen Hoeller * @author Scott Andrews * @author Jeremy Grelle + * @author Rossen Stoyanchev */ public class FormTagTests extends AbstractHtmlElementTagTests {