Class JstlUtils
java.lang.Object
org.springframework.web.servlet.support.JstlUtils
Helper class for preparing JSTL views,
 in particular for exposing a JSTL localization context.
- Since:
- 20.08.2003
- Author:
- Juergen Hoeller
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidexposeLocalizationContext(HttpServletRequest request, MessageSource messageSource) Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.static voidexposeLocalizationContext(RequestContext requestContext) Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.static MessageSourcegetJstlAwareMessageSource(ServletContext servletContext, MessageSource messageSource) Checks JSTL's "jakarta.servlet.jsp.jstl.fmt.localizationContext" context-param and creates a corresponding child message source, with the provided Spring-defined MessageSource as parent.
- 
Constructor Details- 
JstlUtilspublic JstlUtils()
 
- 
- 
Method Details- 
getJstlAwareMessageSourcepublic static MessageSource getJstlAwareMessageSource(@Nullable ServletContext servletContext, MessageSource messageSource) Checks JSTL's "jakarta.servlet.jsp.jstl.fmt.localizationContext" context-param and creates a corresponding child message source, with the provided Spring-defined MessageSource as parent.- Parameters:
- servletContext- the ServletContext we're running in (to check JSTL-related context-params in- web.xml)
- messageSource- the MessageSource to expose, typically the ApplicationContext of the current DispatcherServlet
- Returns:
- the MessageSource to expose to JSTL; first checking the JSTL-defined bundle, then the Spring-defined MessageSource
- See Also:
 
- 
exposeLocalizationContextpublic static void exposeLocalizationContext(HttpServletRequest request, @Nullable MessageSource messageSource) Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.- Parameters:
- request- the current HTTP request
- messageSource- the MessageSource to expose, typically the current ApplicationContext (may be- null)
- See Also:
 
- 
exposeLocalizationContextExposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource.- Parameters:
- requestContext- the context for the current HTTP request, including the ApplicationContext to expose as MessageSource
 
 
-