MesasegResource in struts


Web tier: servlets, JSP, Web frameworks: MesasegResource in struts

  1. MesasegResource in struts (2 messages)


    I haver never worked with struts MessageResources.
    This is the first time.How do I get a messageResource object ?

    I know we have the following way to get it ..

    //Returns a resource bundle for the locale specified in the request,
    MessageResources messageResources = getResources(request);

    but it means I have to store locale in every request?Moreover I would have liked to get it from the session since my locale is there.
    Any suggestions?


    Threaded Messages (2)

  2. MesasegResource in struts[ Go to top ]

    Have you tried using the methods which take a Locale as a parameter,
    such as public String getMessage(Locale locale, String key) ?
    getMessage((Locale)session.getAttribute(localeKey)); just a thought.
  3. correciton[ Go to top ]

    String s = getMessage((Locale)session.getAttribute(localeKey), key);