org.springframework.web.servlet.support
Class JspAwareRequestContext

java.lang.Object
  extended byorg.springframework.web.servlet.support.RequestContext
      extended byorg.springframework.web.servlet.support.JspAwareRequestContext

public class JspAwareRequestContext
extends RequestContext

JSP-aware subclass of RequestContext, allowing population of the context from a JSP PageContext.

This context will also detect a JSTL locale attribute in page scope, in addition to the fallback locale strategy provided by the base class.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
getFallbackLocale()

Field Summary
protected static String PAGE_SCOPE_SUFFIX
           
 
Fields inherited from class org.springframework.web.servlet.support.RequestContext
APPLICATION_SCOPE_SUFFIX, DEFAULT_THEME_NAME, JSTL_LOCALE_ATTRIBUTE, REQUEST_SCOPE_SUFFIX, SESSION_SCOPE_SUFFIX
 
Constructor Summary
JspAwareRequestContext(PageContext pageContext)
          Create a new JspAwareRequestContext for the given page context, using the request attributes for Errors retrieval.
JspAwareRequestContext(PageContext pageContext, Map model)
          Create a new JspAwareRequestContext for the given page context, using the given model attributes for Errors retrieval.
 
Method Summary
protected  Locale getFallbackLocale()
          This implementation looks for a JSTL locale attribute in the JSP page scope, falling back to the superclass if not found.
protected  PageContext getPageContext()
          Return the underlying PageContext.
protected  void initContext(PageContext pageContext, Map model)
          Initialize this context with the given page context, using the given model attributes for Errors retrieval.
 
Methods inherited from class org.springframework.web.servlet.support.RequestContext
getBindStatus, getBindStatus, getContextPath, getErrors, getErrors, getFallbackTheme, getLocale, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getModelObject, getRequest, getRequestUri, getServletContext, getTheme, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getUrlPathHelper, getWebApplicationContext, initContext, isDefaultHtmlEscape, setDefaultHtmlEscape, setUrlPathHelper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAGE_SCOPE_SUFFIX

protected static final String PAGE_SCOPE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

JspAwareRequestContext

public JspAwareRequestContext(PageContext pageContext)
Create a new JspAwareRequestContext for the given page context, using the request attributes for Errors retrieval.

Parameters:
pageContext - current JSP page context

JspAwareRequestContext

public JspAwareRequestContext(PageContext pageContext,
                              Map model)
Create a new JspAwareRequestContext for the given page context, using the given model attributes for Errors retrieval.

Parameters:
pageContext - current JSP page context
model - the model attributes for the current view (can be null, using the request attributes for Errors retrieval)
Method Detail

initContext

protected void initContext(PageContext pageContext,
                           Map model)
Initialize this context with the given page context, using the given model attributes for Errors retrieval.

Parameters:
pageContext - current JSP page context
model - the model attributes for the current view (can be null, using the request attributes for Errors retrieval)

getPageContext

protected PageContext getPageContext()
Return the underlying PageContext. Only intended for cooperating classes in this package.


getFallbackLocale

protected Locale getFallbackLocale()
This implementation looks for a JSTL locale attribute in the JSP page scope, falling back to the superclass if not found.

Overrides:
getFallbackLocale in class RequestContext
Returns:
the fallback locale (never null)
See Also:
RequestContext.getFallbackLocale()


Copyright (C) 2003-2004 The Spring Framework Project.