wood burning stoves 2.0*
The moose likes Struts and the fly likes How to Render All and Individual Errors in One Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to Render All and Individual Errors in One Page" Watch "How to Render All and Individual Errors in One Page" New topic
Author

How to Render All and Individual Errors in One Page

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
My JSP need to report (1) all errors in one place and (2) individual form property's error at their specific location using <html:errors/>. I know a common way is first to add these into resource bundle:

errors.header=<p>Errors Encountered</p><font color=red><ol>
errors.footer=</ol></font>
errors.prefix=<li>
errors.suffix=</li>

Then, I put one <html:errors/> at the top for list of all errors and <html:errors property="propertyname"/> next to each input element for the corresponding property.

Now with this approach, I have a problem where the headers/prefix got printed in my individual error list, too. I just want it be printed at the all error list at the top.

Is there any way to print the headers/prefix for <html:errors/> while leaving them out at each specific <html:errors property="..."/> tag?
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

u dont have such an option with struts 1.1 but after the release of struts 1.2 they had provided all these header,footer,prefix and all as the attributes for the error tag
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Render All and Individual Errors in One Page
 
Similar Threads
doesnt display struts tags in normal html form
Confused on validate() method
need help for critical path analysis in java
Numbered list?
CSS navigation Menu