This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
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

Using ActionMessages to display Errors using errors.headers and errors.footers

 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again all, I am trying to use ActionMessages to display errors. In this particular case I am trying to display an error when the username/password don't validate.
I am able to get the Message I want in question to display on the screen and now it's a matter of properly formatting the result.
I am trying to figure out how to use the errors.header, errors.prefix, errors.suffix and errors.footer in my code. (That way my errors will have consistent look to them.
I am learning this as I go, so this may not be the best manner in which to do this, but here is what I have cobbled together to this point:

in the jsp:




In the action:
// msg is an ActionMessages variable
// errors is an ActionErrors variable
//the rest has been pieced together from various tutorials.





The result is that it displays my header and footer as preformatted when in actuality I am trying to get it to be interpreted as html to keep messages uniform.

Any critiques or suggestions as to how to do this better would greatly be appreciated.

[ March 01, 2007: Message edited by: A knibbs ]
[ March 01, 2007: Message edited by: A knibbs ]
 
Dave Hayward
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have in your ApplicationResources.properties

This is mine:

For me I don't have to add anything extra for my <html:errors /> to show up as a red, UL list. I don't think you need to add anything to the error.message.

Let me know what your ApplicationResources.properties looks like.
 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using MessageResource.properties but mine looks the same as yours. Unfortuantely this is more of a cosmetic thing that has once again been pushed to the side for the moment. I am hoping to get back to it shortly. I will update this post as soon as I can come back to it.

thanks for the reply in the mean time.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic