• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic