类 JstlUtils
java.lang.Object
cn.taketoday.web.servlet.view.JstlUtils
Helper class for preparing JSTL views,
in particular for exposing a JSTL localization context.
- 从以下版本开始:
- 4.0 2022/2/3 22:45
- 作者:
- Juergen Hoeller, Harry Yang
-
嵌套类概要
嵌套类修饰符和类型类说明private static classFramework-specific LocalizationContext adapter that merges session-scoped JSTL LocalizationContext/Locale attributes with the local Framework request context. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidexposeLocalizationContext(RequestContext request, HttpServletRequest servletRequest) Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Framework's locale and MessageSource.static voidexposeLocalizationContext(RequestContext request, HttpServletRequest servletRequest, cn.taketoday.context.MessageSource messageSource) Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Framework's locale and MessageSource.static cn.taketoday.context.MessageSourcegetJstlAwareMessageSource(ServletContext servletContext, cn.taketoday.context.MessageSource messageSource) Checks JSTL's "jakarta.servlet.jsp.jstl.fmt.localizationContext" context-param and creates a corresponding child message source, with the provided Framework-defined MessageSource as parent.static LocalegetLocale(HttpServletRequest request) static TimeZonegetTimeZone(HttpServletRequest request)
-
构造器详细资料
-
JstlUtils
public JstlUtils()
-
-
方法详细资料
-
getJstlAwareMessageSource
public static cn.taketoday.context.MessageSource getJstlAwareMessageSource(@Nullable ServletContext servletContext, cn.taketoday.context.MessageSource messageSource) Checks JSTL's "jakarta.servlet.jsp.jstl.fmt.localizationContext" context-param and creates a corresponding child message source, with the provided Framework-defined MessageSource as parent.- 参数:
servletContext- the ServletContext we're running in (to check JSTL-related context-params inweb.xml)messageSource- the MessageSource to expose, typically the ApplicationContext of the current DispatcherServlet- 返回:
- the MessageSource to expose to JSTL; first checking the JSTL-defined bundle, then the Framework-defined MessageSource
- 另请参阅:
-
ApplicationContext
-
exposeLocalizationContext
public static void exposeLocalizationContext(RequestContext request, HttpServletRequest servletRequest, @Nullable cn.taketoday.context.MessageSource messageSource) Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Framework's locale and MessageSource.- 参数:
request- the current HTTP requestservletRequest- the current HTTP servlet requestmessageSource- the MessageSource to expose, typically the current ApplicationContext (may benull)- 另请参阅:
-
exposeLocalizationContext
public static void exposeLocalizationContext(RequestContext request, HttpServletRequest servletRequest) Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Framework's locale and MessageSource.- 参数:
request- the context for the current HTTP request, including the ApplicationContext to expose as MessageSource
-
getLocale
-
getTimeZone
-