"::SammyRulez::" <[EMAIL PROTECTED]> wrote on 08/25/2005 06:11:54 PM:
> Hi all
> 
> I would like to store in an application scope variable a message
> bundle via listener when the application stat up... something like:
> 
>  public void contextInitialized(ServletContextEvent event) {
> 
>         ResourceBundle strings = ResourceBundle.getBundle("strings");
> 
>         event.getServletContext().setAttribute("labels",strings);
> 
> 
>     }
> 
> and retrive the string messages via jstl whit fmt:message
> 
> <fmt:message bundle="${labels}" key="appWelcome"/>
> 
> but I bump in an exception:
> 
> org.apache.jasper.JasperException: jsp.error.beans.property.conversion
>         org.apache.jasper.runtime.JspRuntimeLibrary.
> getValueFromPropertyEditorManager(JspRuntimeLibrary.java:885)
> 
> 
> any ideas on what obj to use to store string in the application scope
> via servlet context?
<snip/>

javax.servlet.jsp.jstl.fmt.LocalizationContext

i.e.

event.getServletContext().setAttribute("labels", new 
LocalizationContext(strings));

And if anyone asks, I insisted on the two argument constructor ;-)

[ 
http://java.sun.com/products/jsp/jstl/1.1/docs/api/javax/servlet/jsp/jstl/fmt/LocalizationContext.html
 
]

-Rahul


> 
> thanks
> 
> 
> 
> -- 
> ::SammyRulez::
> http://sammyprojectz.blogspot.com
>

Reply via email to