aspose file tools*
The moose likes Struts and the fly likes how control use of errors.footer and errors.header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how control use of errors.footer and errors.header" Watch "how control use of errors.footer and errors.header" New topic
Author

how control use of errors.footer and errors.header

Lance Hill
Greenhorn

Joined: Oct 13, 2004
Posts: 14
Is there some way to control the use of the errors.header and errors.footer elements when using the html:errors tag?

I have both validation and runtime exceptions and would like to format them differently. In the case where I am rendering runtime exceptions, I do not want to use ul and li to display them as there will likely only be one error to display. I apologize if this question has been asked and answered a few times already, but I only find posts on how to show the error within the header and footer.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

It might be smart to place runtime exceptions somewhere other than the ActionErrors. You could always place them in request scope and retrieve them from the jsp that way and format them however you want.


A good workman is known by his tools.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 5269
    
  10

Referring to the latest taglib API documentation, Since Struts 1.2.5, the html:errors tag has the attributes header, footer, prefix, and suffix that allow you to control the rendering of error messages. I personally prefer having the formatting tags in the JSP instead of the resource file so I use html:messages instead, which gives me far greater control over how messages are rendered.



Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how control use of errors.footer and errors.header