Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.web.servlet.support
Class RequestContext

    java.lang.Object
      org.springframework.web.servlet.support.RequestContext

Direct Known Subclasses:
  JspAwareRequestContext

    public class RequestContext

extends java.lang.Object

Context holder for request-specific state, like current web application context, current locale, current theme, and potential binding errors. Provides easy access to localized messages and Errors instances.

Suitable for exposition to views, and usage within JSP's "useBean" tag, JSP scriptlets, JSTL EL, Velocity templates, etc. Necessary for views that do not have access to the servlet request, like Velocity templates.

Can be instantiated manually, or automatically exposed to views as model attribute via AbstractView's "requestContextAttribute" property.

Will also work outside of DispatcherServlet requests, accessing the root WebApplicationContext and using an appropriate fallback for the locale (the HttpServletRequest's primary locale).

Since:
  03.03.2003
Author:
  Juergen Hoeller
See Also:
  `DispatcherServlet`, `AbstractView.setRequestContextAttribute(java.lang.String)`, `UrlBasedViewResolver.setRequestContextAttribute(java.lang.String)`, `getFallbackLocale()`

Field Summary
`static java.lang.String` | `DEFAULT_THEME_NAME` Default theme name used if the RequestContext cannot find a ThemeResolver.
`protected static boolean` | `jstlPresent`
`static java.lang.String` | `WEB_APPLICATION_CONTEXT_ATTRIBUTE` Request attribute to hold the current web application context for RequestContext usage.

Constructor Summary
`protected` | `RequestContext()` Default constructor for subclasses.
`` | `RequestContext(javax.servlet.http.HttpServletRequest request)` Create a new RequestContext for the given request, using the request attributes for Errors retrieval.
`` | `RequestContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, java.util.Map<java.lang.String,java.lang.Object> model)` Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.
`` | `RequestContext(javax.servlet.http.HttpServletRequest request, java.util.Map<java.lang.String,java.lang.Object> model)` Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.
`` | `RequestContext(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext)` Create a new RequestContext for the given request, using the request attributes for Errors retrieval.

Method Summary
`BindStatus` | `getBindStatus(java.lang.String path)` Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.
`BindStatus` | `getBindStatus(java.lang.String path, boolean htmlEscape)` Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.
`java.lang.String` | `getContextPath()` Return the context path of the original request, that is, the path that indicates the current web application.
`java.lang.String` | `getContextUrl(java.lang.String relativeUrl)` Return a context-aware URl for the given relative URL.
`java.lang.String` | `getContextUrl(java.lang.String relativeUrl, java.util.Map<java.lang.String,?> params)` Return a context-aware URl for the given relative URL with placeholders (named keys with braces `{}`).
`java.lang.Boolean` | `getDefaultHtmlEscape()` Return the default HTML escape setting, differentiating between no default specified and an explicit value.
`Errors` | `getErrors(java.lang.String name)` Retrieve the Errors instance for the given bind object, using the "defaultHtmlEscape" setting.
`Errors` | `getErrors(java.lang.String name, boolean htmlEscape)` Retrieve the Errors instance for the given bind object.
`protected java.util.Locale` | `getFallbackLocale()` Determine the fallback locale for this context.
`protected Theme` | `getFallbackTheme()` Determine the fallback theme for this context.
`java.util.Locale` | `getLocale()` Return the current Locale (never `null`).
`java.lang.String` | `getMessage(MessageSourceResolvable resolvable)` Retrieve the given MessageSourceResolvable (e.g.
`java.lang.String` | `getMessage(MessageSourceResolvable resolvable, boolean htmlEscape)` Retrieve the given MessageSourceResolvable (e.g.
`java.lang.String` | `getMessage(java.lang.String code)` Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
`java.lang.String` | `getMessage(java.lang.String code, java.util.List args)` Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
`java.lang.String` | `getMessage(java.lang.String code, java.util.List args, java.lang.String defaultMessage)` Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
`java.lang.String` | `getMessage(java.lang.String code, java.lang.Object[] args)` Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
`java.lang.String` | `getMessage(java.lang.String code, java.lang.Object[] args, boolean htmlEscape)` Retrieve the message for the given code.
`java.lang.String` | `getMessage(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage)` Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
`java.lang.String` | `getMessage(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage, boolean htmlEscape)` Retrieve the message for the given code.
`java.lang.String` | `getMessage(java.lang.String code, java.lang.String defaultMessage)` Retrieve the message for the given code, using the "defaultHtmlEscape" setting.
`MessageSource` | `getMessageSource()` Return the current WebApplicationContext as MessageSource.
`java.util.Map<java.lang.String,java.lang.Object>` | `getModel()` Return the model Map that this RequestContext encapsulates, if any.
`protected java.lang.Object` | `getModelObject(java.lang.String modelName)` Retrieve the model object for the given model name, either from the model or from the request attributes.
`java.lang.String` | `getPathToServlet()` Return the path to URL mappings within the current servlet including the context path and the servlet path of the original request.
`java.lang.String` | `getQueryString()` Return the query string of the current request, that is, the part after the request path.
`protected javax.servlet.http.HttpServletRequest` | `getRequest()` Return the underlying HttpServletRequest.
`RequestDataValueProcessor` | `getRequestDataValueProcessor()` Return the RequestDataValueProcessor instance to use obtained from the WebApplicationContext under the name `"requestDataValueProcessor"`.
`java.lang.String` | `getRequestUri()` Return the request URI of the original request, that is, the invoked URL without parameters.
`protected javax.servlet.ServletContext` | `getServletContext()` Return the underlying ServletContext.
`Theme` | `getTheme()` Return the current theme (never `null`).
`java.lang.String` | `getThemeMessage(MessageSourceResolvable resolvable)` Retrieve the given MessageSourceResolvable in the current theme.
`java.lang.String` | `getThemeMessage(java.lang.String code)` Retrieve the theme message for the given code.
`java.lang.String` | `getThemeMessage(java.lang.String code, java.util.List args)` Retrieve the theme message for the given code.
`java.lang.String` | `getThemeMessage(java.lang.String code, java.util.List args, java.lang.String defaultMessage)` Retrieve the theme message for the given code.
`java.lang.String` | `getThemeMessage(java.lang.String code, java.lang.Object[] args)` Retrieve the theme message for the given code.
`java.lang.String` | `getThemeMessage(java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage)` Retrieve the theme message for the given code.
`java.lang.String` | `getThemeMessage(java.lang.String code, java.lang.String defaultMessage)` Retrieve the theme message for the given code.
`UrlPathHelper` | `getUrlPathHelper()` Return the UrlPathHelper used for context path and request URI decoding.
`WebApplicationContext` | `getWebApplicationContext()` Return the current WebApplicationContext.
`protected void` | `initContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, java.util.Map<java.lang.String,java.lang.Object> model)` Initialize this context with the given request, using the given model attributes for Errors retrieval.
`boolean` | `isDefaultHtmlEscape()` Is default HTML escaping active? Falls back to `false` in case of no explicit default given.
`void` | `setDefaultHtmlEscape(boolean defaultHtmlEscape)` (De)activate default HTML escaping for messages and errors, for the scope of this RequestContext.
`void` | `setUrlPathHelper(UrlPathHelper urlPathHelper)` Set the UrlPathHelper to use for context path and request URI decoding.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_THEME_NAME

    public static final java.lang.String DEFAULT_THEME_NAME

  Default theme name used if the RequestContext cannot find a ThemeResolver. Only applies to non-DispatcherServlet requests.

  Same as AbstractThemeResolver's default, but not linked in here to avoid package interdependencies.

  See Also:
    `AbstractThemeResolver.ORIGINAL_DEFAULT_THEME_NAME`, Constant Field Values

### WEB_APPLICATION_CONTEXT_ATTRIBUTE

    public static final java.lang.String WEB_APPLICATION_CONTEXT_ATTRIBUTE

  Request attribute to hold the current web application context for RequestContext usage. By default, the DispatcherServlet's context (or the root context as fallback) is exposed.

### jstlPresent

    protected static final boolean jstlPresent

Constructor Detail

### RequestContext

    public RequestContext(javax.servlet.http.HttpServletRequest request)

  Create a new RequestContext for the given request, using the request attributes for Errors retrieval.

  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.

  Will only work within a DispatcherServlet request. Pass in a ServletContext to be able to fallback to the root WebApplicationContext.

  Parameters:
    `request` - current HTTP request
  See Also:
    `DispatcherServlet`, `RequestContext(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext)`

### RequestContext

    public RequestContext(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.ServletContext servletContext)

  Create a new RequestContext for the given request, using the request attributes for Errors retrieval.

  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.

  If a ServletContext is specified, the RequestContext will also work with the root WebApplicationContext (outside a DispatcherServlet).

  Parameters:
    `request` - current HTTP request
    `servletContext` - the servlet context of the web application (can be `null`; necessary for fallback to root WebApplicationContext)
  See Also:
    `WebApplicationContext`, `DispatcherServlet`

### RequestContext

    public RequestContext(javax.servlet.http.HttpServletRequest request,
                          java.util.Map<java.lang.String,java.lang.Object> model)

  Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.

  This works with all View implementations. It will typically be used by View implementations.

  Will only work within a DispatcherServlet request. Pass in a ServletContext to be able to fallback to the root WebApplicationContext.

  Parameters:
    `request` - current HTTP request
    `model` - the model attributes for the current view (can be `null`, using the request attributes for Errors retrieval)
  See Also:
    `DispatcherServlet`, `RequestContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext, Map)`

### RequestContext

    public RequestContext(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response,
                          javax.servlet.ServletContext servletContext,
                          java.util.Map<java.lang.String,java.lang.Object> model)

  Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.

  This works with all View implementations. It will typically be used by View implementations.

  If a ServletContext is specified, the RequestContext will also work with a root WebApplicationContext (outside a DispatcherServlet).

  Parameters:
    `request` - current HTTP request
    `response` - current HTTP response
    `servletContext` - the servlet context of the web application (can be `null`; necessary for fallback to root WebApplicationContext)
    `model` - the model attributes for the current view (can be `null`, using the request attributes for Errors retrieval)
  See Also:
    `WebApplicationContext`, `DispatcherServlet`

### RequestContext

    protected RequestContext()

  Default constructor for subclasses.

Method Detail

### initContext

    protected void initContext(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response,
                               javax.servlet.ServletContext servletContext,
                               java.util.Map<java.lang.String,java.lang.Object> model)

  Initialize this context with the given request, using the given model attributes for Errors retrieval.

  Delegates to `getFallbackLocale` and `getFallbackTheme` for determining the fallback locale and theme, respectively, if no LocaleResolver and/or ThemeResolver can be found in the request.

  Parameters:
    `request` - current HTTP request
    `servletContext` - the servlet context of the web application (can be `null`; necessary for fallback to root WebApplicationContext)
    `model` - the model attributes for the current view (can be `null`, using the request attributes for Errors retrieval)
  See Also:
    `getFallbackLocale()`, `getFallbackTheme()`, `DispatcherServlet.LOCALE_RESOLVER_ATTRIBUTE`, `DispatcherServlet.THEME_RESOLVER_ATTRIBUTE`

### getFallbackLocale

    protected java.util.Locale getFallbackLocale()

  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 `HttpServletRequest.getLocale()`.

  Returns:
    the fallback locale (never `null`)
  See Also:
    `ServletRequest.getLocale()`

### getFallbackTheme

    protected Theme getFallbackTheme()

  Determine the fallback theme for this context.

  The default implementation returns the default theme (with name "theme").

  Returns:
    the fallback theme (never `null`)

### getRequest

    protected final javax.servlet.http.HttpServletRequest getRequest()

  Return the underlying HttpServletRequest. Only intended for cooperating classes in this package.

### getServletContext

    protected final javax.servlet.ServletContext getServletContext()

  Return the underlying ServletContext. Only intended for cooperating classes in this package.

### getWebApplicationContext

    public final WebApplicationContext getWebApplicationContext()

  Return the current WebApplicationContext.

### getMessageSource

    public final MessageSource getMessageSource()

  Return the current WebApplicationContext as MessageSource.

### getModel

    public final java.util.Map<java.lang.String,java.lang.Object> getModel()

  Return the model Map that this RequestContext encapsulates, if any.

  Returns:
    the populated model Map, or `null` if none available

### getLocale

    public final java.util.Locale getLocale()

  Return the current Locale (never `null`).

### getTheme

    public final Theme getTheme()

  Return the current theme (never `null`).

  Resolved lazily for more efficiency when theme support is not being used.

### setDefaultHtmlEscape

    public void setDefaultHtmlEscape(boolean defaultHtmlEscape)

  (De)activate default HTML escaping for messages and errors, for the scope of this RequestContext. The default is the application-wide setting (the "defaultHtmlEscape" context-param in web.xml).

  See Also:
    `WebUtils.isDefaultHtmlEscape(javax.servlet.ServletContext)`

### isDefaultHtmlEscape

    public boolean isDefaultHtmlEscape()

  Is default HTML escaping active? Falls back to `false` in case of no explicit default given.

### getDefaultHtmlEscape

    public java.lang.Boolean getDefaultHtmlEscape()

  Return the default HTML escape setting, differentiating between no default specified and an explicit value.

  Returns:
    whether default HTML escaping is enabled (null = no explicit default)

### setUrlPathHelper

    public void setUrlPathHelper(UrlPathHelper urlPathHelper)

  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.

### getUrlPathHelper

    public UrlPathHelper getUrlPathHelper()

  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.

### getRequestDataValueProcessor

    public RequestDataValueProcessor getRequestDataValueProcessor()

  Return the RequestDataValueProcessor instance to use obtained from the WebApplicationContext under the name `"requestDataValueProcessor"`. Or `null` if no matching bean was found.

### getContextPath

    public java.lang.String getContextPath()

  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.

  See Also:
    `HttpServletRequest.getContextPath()`, `getUrlPathHelper()`

### getContextUrl

    public java.lang.String getContextUrl(java.lang.String relativeUrl)

  Return a context-aware URl for the given relative URL.

  Parameters:
    `relativeUrl` - the relative URL part
  Returns:
    a URL that points back to the server with an absolute path (also URL-encoded accordingly)

### getContextUrl

    public java.lang.String getContextUrl(java.lang.String relativeUrl,
                                          java.util.Map<java.lang.String,?> params)

  Return a context-aware URl for the given relative URL with placeholders (named keys with braces `{}`). For example, send in a relative URL `foo/{bar}?spam={spam}` and a parameter map `{bar=baz,spam=nuts}` and the result will be `[contextpath]/foo/baz?spam=nuts`.

  Parameters:
    `relativeUrl` - the relative URL part
    `params` - a map of parameters to insert as placeholders in the url
  Returns:
    a URL that points back to the server with an absolute path (also URL-encoded accordingly)

### getPathToServlet

    public java.lang.String getPathToServlet()

  Return the path to URL mappings within the current servlet including the 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 `"/main/*"` is used.

  Delegates to the UrlPathHelper for decoding the context path.

  See Also:
    `HttpServletRequest.getContextPath()`, `HttpServletRequest.getServletPath()`, `getUrlPathHelper()`

### getRequestUri

    public java.lang.String getRequestUri()

  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.

  See Also:
    `getQueryString()`, `UrlPathHelper.getOriginatingRequestUri(javax.servlet.http.HttpServletRequest)`, `getUrlPathHelper()`

### getQueryString

    public java.lang.String getQueryString()

  Return the query string of the current request, that is, the part after the request path. This is particularly useful for building an HTML form action target in combination with the original request URI.

  Note this implementation will correctly resolve to the query string 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.

  See Also:
    `getRequestUri()`, `UrlPathHelper.getOriginatingQueryString(javax.servlet.http.HttpServletRequest)`, `getUrlPathHelper()`

### getMessage

    public java.lang.String getMessage(java.lang.String code,
                                       java.lang.String defaultMessage)

  Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

  Parameters:
    `code` - code of the message
    `defaultMessage` - String to return if the lookup fails
  Returns:
    the message

### getMessage

    public java.lang.String getMessage(java.lang.String code,
                                       java.lang.Object[] args,
                                       java.lang.String defaultMessage)

  Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

  Parameters:
    `code` - code of the message
    `args` - arguments for the message, or `null` if none
    `defaultMessage` - String to return if the lookup fails
  Returns:
    the message

### getMessage

    public java.lang.String getMessage(java.lang.String code,
                                       java.util.List args,
                                       java.lang.String defaultMessage)

  Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

  Parameters:
    `code` - code of the message
    `args` - arguments for the message as a List, or `null` if none
    `defaultMessage` - String to return if the lookup fails
  Returns:
    the message

### getMessage

    public java.lang.String getMessage(java.lang.String code,
                                       java.lang.Object[] args,
                                       java.lang.String defaultMessage,
                                       boolean htmlEscape)

  Retrieve the message for the given code.

  Parameters:
    `code` - code of the message
    `args` - arguments for the message, or `null` if none
    `defaultMessage` - String to return if the lookup fails
    `htmlEscape` - HTML escape the message?
  Returns:
    the message

### getMessage

    public java.lang.String getMessage(java.lang.String code)
                                throws NoSuchMessageException

  Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

  Parameters:
    `code` - code of the message
  Returns:
    the message
  Throws:
    `NoSuchMessageException` - if not found

### getMessage

    public java.lang.String getMessage(java.lang.String code,
                                       java.lang.Object[] args)
                                throws NoSuchMessageException

  Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

  Parameters:
    `code` - code of the message
    `args` - arguments for the message, or `null` if none
  Returns:
    the message
  Throws:
    `NoSuchMessageException` - if not found

### getMessage

    public java.lang.String getMessage(java.lang.String code,
                                       java.util.List args)
                                throws NoSuchMessageException

  Retrieve the message for the given code, using the "defaultHtmlEscape" setting.

  Parameters:
    `code` - code of the message
    `args` - arguments for the message as a List, or `null` if none
  Returns:
    the message
  Throws:
    `NoSuchMessageException` - if not found

### getMessage

    public java.lang.String getMessage(java.lang.String code,
                                       java.lang.Object[] args,
                                       boolean htmlEscape)
                                throws NoSuchMessageException

  Retrieve the message for the given code.

  Parameters:
    `code` - code of the message
    `args` - arguments for the message, or `null` if none
    `htmlEscape` - HTML escape the message?
  Returns:
    the message
  Throws:
    `NoSuchMessageException` - if not found

### getMessage

    public java.lang.String getMessage(MessageSourceResolvable resolvable)
                                throws NoSuchMessageException

  Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance), using the "defaultHtmlEscape" setting.

  Parameters:
    `resolvable` - the MessageSourceResolvable
  Returns:
    the message
  Throws:
    `NoSuchMessageException` - if not found

### getMessage

    public java.lang.String getMessage(MessageSourceResolvable resolvable,
                                       boolean htmlEscape)
                                throws NoSuchMessageException

  Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance).

  Parameters:
    `resolvable` - the MessageSourceResolvable
    `htmlEscape` - HTML escape the message?
  Returns:
    the message
  Throws:
    `NoSuchMessageException` - if not found

### getThemeMessage

    public java.lang.String getThemeMessage(java.lang.String code,
                                            java.lang.String defaultMessage)

  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.

  Parameters:
    `code` - code of the message
    `defaultMessage` - String to return if the lookup fails
  Returns:
    the message

### getThemeMessage

    public java.lang.String getThemeMessage(java.lang.String code,
                                            java.lang.Object[] args,
                                            java.lang.String defaultMessage)

  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.

  Parameters:
    `code` - code of the message
    `args` - arguments for the message, or `null` if none
    `defaultMessage` - String to return if the lookup fails
  Returns:
    the message

### getThemeMessage

    public java.lang.String getThemeMessage(java.lang.String code,
                                            java.util.List args,
                                            java.lang.String defaultMessage)

  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.

  Parameters:
    `code` - code of the message
    `args` - arguments for the message as a List, or `null` if none
    `defaultMessage` - String to return if the lookup fails
  Returns:
    the message

### getThemeMessage

    public java.lang.String getThemeMessage(java.lang.String code)
                                     throws NoSuchMessageException

  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.

  Parameters:
    `code` - code of the message
  Returns:
    the message
  Throws:
    `NoSuchMessageException` - if not found

### getThemeMessage

    public java.lang.String getThemeMessage(java.lang.String code,
                                            java.lang.Object[] args)
                                     throws NoSuchMessageException

  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.

  Parameters:
    `code` - code of the message
    `args` - arguments for the message, or `null` if none
  Returns:
    the message
  Throws:
    `NoSuchMessageException` - if not found

### getThemeMessage

    public java.lang.String getThemeMessage(java.lang.String code,
                                            java.util.List args)
                                     throws NoSuchMessageException

  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.

  Parameters:
    `code` - code of the message
    `args` - arguments for the message as a List, or `null` if none
  Returns:
    the message
  Throws:
    `NoSuchMessageException` - if not found

### getThemeMessage

    public java.lang.String getThemeMessage(MessageSourceResolvable resolvable)
                                     throws NoSuchMessageException

  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.

  Parameters:
    `resolvable` - the MessageSourceResolvable
  Returns:
    the message
  Throws:
    `NoSuchMessageException` - if not found

### getErrors

    public Errors getErrors(java.lang.String name)

  Retrieve the Errors instance for the given bind object, using the "defaultHtmlEscape" setting.

  Parameters:
    `name` - name of the bind object
  Returns:
    the Errors instance, or `null` if not found

### getErrors

    public Errors getErrors(java.lang.String name,
                            boolean htmlEscape)

  Retrieve the Errors instance for the given bind object.

  Parameters:
    `name` - name of the bind object
    `htmlEscape` - create an Errors instance with automatic HTML escaping?
  Returns:
    the Errors instance, or `null` if not found

### getModelObject

    protected java.lang.Object getModelObject(java.lang.String modelName)

  Retrieve the model object for the given model name, either from the model or from the request attributes.

  Parameters:
    `modelName` - the name of the model object
  Returns:
    the model object

### getBindStatus

    public BindStatus getBindStatus(java.lang.String path)
                             throws java.lang.IllegalStateException

  Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.

  Parameters:
    `path` - the bean and property path for which values and errors will be resolved (e.g. "person.age")
  Returns:
    the new BindStatus instance
  Throws:
    `java.lang.IllegalStateException` - if no corresponding Errors object found

### getBindStatus

    public BindStatus getBindStatus(java.lang.String path,
                                    boolean htmlEscape)
                             throws java.lang.IllegalStateException

  Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.

  Parameters:
    `path` - the bean and property path for which values and errors will be resolved (e.g. "person.age")
    `htmlEscape` - create a BindStatus with automatic HTML escaping?
  Returns:
    the new BindStatus instance
  Throws:
    `java.lang.IllegalStateException` - if no corresponding Errors object found

Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD