Hi! I want to create kind of centralized jsp page for displayng messages/errors from resource file. Jsp has a folowing line of code:
Now the action class which is executing puts in a request the key for this message like this: . Resource file has a message under the key msg01-01. That is working fine. Now the question is how to pass an arguments from action to this page? I mean those arguments which in other way would be handled by arg0, arg1 etc parameters in bean:message tag? Any ideas? Or maybe example of better implementation of such page? Thx in advance...
Joined: Feb 15, 2005
I fail to see the advantage in doing it this way over simply populating the ActionMessages object in the Action class and using the <html:messages> tag to display them.
Since the ActionMessages object is stored in the request, you can still use a central JSP to display them, and you will have no problem passing parameters to the message.
For more information on this, see the heading "displaying messages" in this link. [ June 20, 2006: Message edited by: Merrill Higginson ]
Hi Thanks for reply. Well I think you are right. I was thinking on this too, but for some reason avoided that way, maybe because creating ActionMessages objects requires more code in Action. Now I think I will stick to it Thanks!