I think he's saying that the exception should be thrown earlier, at the point
of execution in the action bean, rather than after the fact in the jsp. Seems
reasonable to me, but either way it's basically the same thing. Bottom line is
get your keys correct and test both bean/jsp.
You could change that to
ResourceBundle resourceBundle = <get a reference to your resource bundle
however>;
getContext (). getMessages (). add (new SimpleMessage
(resourceBundle.getMessage("miss.message.text")));
From: Frank Pavageau [mailto:frank.pavag...@gmail.com]
Sent: Wednesday, October 06, 2010 2:22 PM
To: Stripes Users List
Subject: Re: [Stripes-users] Bug stripes messages
On Wed, Oct 6, 2010 at 7:43 PM, andres
<ispanand...@yahoo.es<mailto:ispanand...@yahoo.es>> wrote:
I discovered a bug in the Stripes messages.
If you add in the action, message that does not exist
getContext (). getMessages (). add (new LocalizableMessage ("miss.message.text
"));
and in jsp
<s:messages/>
will fail in the jsp
GRAVE:
java.util.MissingResourceException: Can not find resource for bundle ...
I can catch with a try in jsp but it is ugly, another option, is to check
message if exist before add to messages.
Jsp should not fail, giving blank message or replaced by another generic error
message.
It's not a bug, it's a feature. It's supposed to fail with an exception if you
use an invalid key. Otherwise it would go mainly unnoticed.
Frank
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users