Class JspAwareRequestContext
java.lang.Object
org.springframework.web.servlet.support.RequestContext
org.springframework.web.servlet.support.JspAwareRequestContext
JSP-aware (and JSTL-aware) subclass of RequestContext, allowing for
 population of the context from a 
jakarta.servlet.jsp.PageContext.
 This context will detect a JSTL locale attribute in page/request/session/application scope, in addition to the fallback locale strategy provided by the base class.
- Since:
- 1.1.4
- Author:
- Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class org.springframework.web.servlet.support.RequestContextjstlPresent, WEB_APPLICATION_CONTEXT_ATTRIBUTE
- 
Constructor SummaryConstructorsConstructorDescriptionJspAwareRequestContext(PageContext pageContext) Create a new JspAwareRequestContext for the given page context, using the request attributes for Errors retrieval.JspAwareRequestContext(PageContext pageContext, @Nullable Map<String, Object> model) Create a new JspAwareRequestContext for the given page context, using the given model attributes for Errors retrieval.
- 
Method SummaryModifier and TypeMethodDescriptionprotected LocaleThis implementation checks for a JSTL locale attribute in page, request, session or application scope; if not found, returns theHttpServletRequest.getLocale().This implementation checks for a JSTL time zone attribute in page, request, session or application scope; if not found, returnsnull.protected final PageContextReturn the underlying PageContext.Methods inherited from class org.springframework.web.servlet.support.RequestContextchangeLocale, changeLocale, getBindStatus, getBindStatus, getContextPath, getContextUrl, getContextUrl, getDefaultHtmlEscape, getErrors, getErrors, getLocale, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessageSource, getModel, getModelObject, getPathToServlet, getQueryString, getRequest, getRequestDataValueProcessor, getRequestUri, getResponseEncodedHtmlEscape, getServletContext, getTimeZone, getUrlPathHelper, getWebApplicationContext, isDefaultHtmlEscape, isResponseEncodedHtmlEscape, setDefaultHtmlEscape, setUrlPathHelper
- 
Constructor Details- 
JspAwareRequestContextCreate a new JspAwareRequestContext for the given page context, using the request attributes for Errors retrieval.- Parameters:
- pageContext- current JSP page context
 
- 
JspAwareRequestContextCreate 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 Details- 
getPageContextReturn the underlying PageContext. Only intended for cooperating classes in this package.
- 
getFallbackLocaleThis implementation checks for a JSTL locale attribute in page, request, session or application scope; if not found, returns theHttpServletRequest.getLocale().- Overrides:
- getFallbackLocalein class- RequestContext
- Returns:
- the fallback locale (never null)
- See Also:
 
- 
getFallbackTimeZoneThis implementation checks for a JSTL time zone attribute in page, request, session or application scope; if not found, returnsnull.- Overrides:
- getFallbackTimeZonein class- RequestContext
- Returns:
- the fallback time zone (or nullif none derivable from the request)
 
 
-