Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

arguments for bean:message

 
Ilja Smoli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ilja Smoli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic