| Modifier and Type | Class and Description |
|---|---|
| private static class | JstlUtils.
Spring-specific LocalizationContext adapter that merges session-scoped JSTL LocalizationContext/Locale attributes with the local Spring request context. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | exposeLocalizationContext(HttpServletRequest
the current HTTP request request, MessageSource the MessageSource to expose,
typically the current ApplicationContext (may be messageSource)null)Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource. |
| public static void | exposeLocalizationContext(RequestContext
the context for the current HTTP request,
including the ApplicationContext to expose as MessageSource requestContext)Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and MessageSource. |
| public static MessageSource | Returns: the MessageSource to expose to JSTL; first checking the JSTL-defined bundle, then the Spring-defined MessageSourcethe ServletContext we're running in
(to check JSTL-related context-params in servletContext, MessageSource web.xml)the MessageSource to expose, typically
the ApplicationContext of the current DispatcherServlet 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. |
| JstlUtils | back to summary |
|---|---|
| public JstlUtils() | |
| exposeLocalizationContext | back to summary |
|---|---|
| public static void exposeLocalizationContext(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.
| |
| exposeLocalizationContext | back to summary |
|---|---|
| public static void exposeLocalizationContext(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.
| |
| getJstlAwareMessageSource | back to summary |
|---|---|
| public static MessageSource getJstlAwareMessageSource(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.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final MessageSource | |
| private final HttpServletRequest |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Locale | getLocale()
Overrides jakarta. Gets the locale of this I18N localization context. |
| public ResourceBundle | getResourceBundle()
Overrides jakarta. Gets the resource bundle of this I18N localization context. |
| messageSource | back to summary |
|---|---|
| private final MessageSource messageSource | |
| request | back to summary |
|---|---|
| private final HttpServletRequest request | |
| SpringLocalizationContext | back to summary |
|---|---|
| public SpringLocalizationContext(MessageSource messageSource, HttpServletRequest request) | |
| getLocale | back to summary |
|---|---|
| public Locale getLocale() Overrides jakarta. Doc from jakarta. Gets the locale of this I18N localization context. | |
| getResourceBundle | back to summary |
|---|---|
| public ResourceBundle getResourceBundle() Overrides jakarta. Doc from jakarta. Gets the resource bundle of this I18N localization context.
| |