tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Honza Spurný <>
Subject MessageResources in Model
Date Thu, 26 Aug 2004 12:49:13 GMT
Hi there,

I know this is not request for Tomcat mailing list, but since I could not
connect to struts mailing list, I've tried last chance here :o) Thanks for

I have my own class called CountrySeparator:

public class CountrySeparator {

I'd like to use messageResources here in some method, so I have design this

public static String getSomething(HttpServletRequest, String key)
    // I have locale stored in session
    Locale locale = (Locale)request.getSession().getAttribute("locale");
    MessageResources messages =

    return messges.getMessage(locale, key);

BUT on the line with
    return messges.getMessage(locale, key);
command, it throws exception about null pointer. When I try to printout the
messages object, it writes me "null" :(

So it means, that I has not been able to access MessageResources object.

What I'm supposed to do to acccess this object?

Please could anybody help?

Thanks a lot.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message