类 JspAwareRequestContext
- java.lang.Object
- org.springframework.web.servlet.support.RequestContext
- org.springframework.web.servlet.support.JspAwareRequestContext
public class JspAwareRequestContext extends RequestContext
JSP-aware (and JSTL-aware) subclass of RequestContext, allowing for population of the context from ajavax.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.
- 从以下版本开始:
- 1.1.4
- 作者:
- Juergen Hoeller
- 另请参阅:
getFallbackLocale()
字段概要
从类继承的字段 org.springframework.web.servlet.support.RequestContext
DEFAULT_THEME_NAME, jstlPresent, WEB_APPLICATION_CONTEXT_ATTRIBUTE
构造器概要
构造器 构造器 说明 JspAwareRequestContext(PageContext pageContext)
Create a new JspAwareRequestContext for the given page context, using the request attributes for Errors retrieval.JspAwareRequestContext(PageContext pageContext, Map<String,Object> model)
Create a new JspAwareRequestContext for the given page context, using the given model attributes for Errors retrieval.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected Locale
getFallbackLocale()
This implementation checks for a JSTL locale attribute in page, request, session or application scope; if not found, returns theHttpServletRequest.getLocale()
.protected TimeZone
getFallbackTimeZone()
This implementation checks for a JSTL time zone attribute in page, request, session or application scope; if not found, returnsnull
.protected PageContext
getPageContext()
Return the underlying PageContext.从类继承的方法 org.springframework.web.servlet.support.RequestContext
changeLocale, changeLocale, changeTheme, changeTheme, getBindStatus, getBindStatus, getContextPath, getContextUrl, getContextUrl, getDefaultHtmlEscape, getErrors, getErrors, getFallbackTheme, getLocale, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessageSource, getModel, getModelObject, getPathToServlet, getQueryString, getRequest, getRequestDataValueProcessor, getRequestUri, getResponseEncodedHtmlEscape, getServletContext, getTheme, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getThemeMessage, getTimeZone, getUrlPathHelper, getWebApplicationContext, isDefaultHtmlEscape, isResponseEncodedHtmlEscape, setDefaultHtmlEscape, setUrlPathHelper
构造器详细资料
JspAwareRequestContext
public JspAwareRequestContext(PageContext pageContext)
Create a new JspAwareRequestContext for the given page context, using the request attributes for Errors retrieval.- 参数:
pageContext
- current JSP page context
JspAwareRequestContext
public 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.- 参数:
pageContext
- current JSP page contextmodel
- the model attributes for the current view (can benull
, using the request attributes for Errors retrieval)
方法详细资料
getPageContext
protected final PageContext getPageContext()
Return the underlying PageContext. Only intended for cooperating classes in this package.
getFallbackLocale
protected Locale getFallbackLocale()
This implementation checks for a JSTL locale attribute in page, request, session or application scope; if not found, returns theHttpServletRequest.getLocale()
.- 覆盖:
getFallbackLocale
在类中RequestContext
- 返回:
- the fallback locale (never
null
) - 另请参阅:
ServletRequest.getLocale()
getFallbackTimeZone
protected TimeZone getFallbackTimeZone()
This implementation checks for a JSTL time zone attribute in page, request, session or application scope; if not found, returnsnull
.- 覆盖:
getFallbackTimeZone
在类中RequestContext
- 返回:
- the fallback time zone (or
null
if none derivable from the request)