This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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.
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.