Results 1 to 4 of 4

Thread: Disabling localeResolver?

  1. #1
    Join Date
    Aug 2004
    Posts
    14

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Linz, Austria
    Posts
    391

    Default

    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

  3. #3
    Join Date
    Aug 2004
    Posts
    14

    Default

    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!

  4. #4
    Join Date
    Sep 2004
    Location
    St Stevens Woluwe, Belgium
    Posts
    8

    Default

    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
    I've got plenty of java and Chesterfield Kings
    Donald Fagan - The nightfly

Similar Threads

  1. disabling log4j output
    By bernardsirius in forum Web
    Replies: 3
    Last Post: Feb 11th, 2005, 10:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •