Announcement Announcement Module
Collapse
No announcement yet.
Disabling localeResolver? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Disabling localeResolver?

    Hi!

    I use localization in jsp-s using JSTL <fmt:setLocale > tag.

    But spring's localeResolver seems to spoil things. So i would like to use spring without localeResolver. So how to disable it? I created my mock class of SessionLocaleResolver but overriding setLocale doesn't work.

    thanks!

  • #2
    Spring's default LocaleResolver, AcceptHeaderLocaleResolver, should exactly mirror standard JSTL behavior: It uses the Locale returned by HttpServletRequest.getLocale(). I wonder what kind of side effects you want to get rid of with a custom LocaleResolver implementation... Could you elaborate a bit?

    Juergen

    Comment


    • #3
      I got it working already! Previously I specified localization property files in web.xml but with Spring I had to configure it using messageSource bean in application context.
      Thanks!

      Comment


      • #4
        Wait... I've got a similar problem (spring 1.0.1)
        my jsp (day is a model attribute):
        <fmt:setLocale value="nl" />
        <fmt:formatDate value="${day}" type="date" dateStyle="long" />

        The date is displayed in dutch if I set no class for the viewResolver in my
        dispatcher config file,
        but if I set the viewresolver class to JstlView, fmt:setLocale
        does not have an effect anymore, and the date displays in english.
        ??

        Jan

        Comment

        Working...
        X