2014-05-06 18:30 GMT+02:00 Bruno Klava <bkl...@gmail.com>:
> Hi,
>
> in order to load a message from a *.properties file from a servlet, I used
> to do:
>
> new ActionSupport().getText(messageKey);

Do you use it inside Struts action? ActionContext is action specific
which means you cannot access it from outside, from other thread.
Another thing creating actions by new is allowed only in tests as
framework must prepare environment and inject dependencies, if this
worked it was a bug ;-)

> It used to work in Struts versions up to 2.3.15.3.
>
> In Struts 2.3.16+ versions, now I get a NPE:
>
> java.lang.NullPointerException
> at
> com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:361)
>  at
> com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:208)
> at
> com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:123)
>  at com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:103)
>
> Is there a new way (or even an old one :) to get messages from a servlet
> context?

Have you tried to use the latest snapshot version? 2.3.18-SNAPSHOT?
Some similar issue was solved already


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to