There is an html:messages tag that is basically the
same as html:errors except it iterates over messages
and errors so you can remove the html from the message
resources.  There are the classes ActionMessages and
ActionMessage for general messages like "Record has
been deleted.".  ActionErrors is a subclass of
ActionMessages and ActionError is a subclass of
ActionMessage.  I'm working on adding some
documentation with code examples for this.

  <h3><font color="red"><bean:message
key="errors.header"/></font></h3>

  <ul>
  <html:messages id="message">
     <li><bean:write name="message"/></li>
  </html:messages>
  </ul>

  errors.header=Validation Error

or

  <html:messages id="message" header="errors.header"
footer="errors.footer">
     <li><bean:write name="message"/></li>
  </html:messages>

  errors.header=<h3><font color="red">Validation
Error</font></h3>
    You must correct the following error(s) before
proceeding:<UL>
  errors.footer=</ul><hr>

The header and footer attributes are optional.

David

--- "Deadman, Hal" <[EMAIL PROTECTED]> wrote:
> I think a new tag that allows you to not put HTML in
> your resource file
> already exists in post 1.0 Struts in the form of the
> <html:messsage(s)> tag.
> It can be used in place of <html:errors>. The errors
> class is now a subclass
> of a message class.
> 
> -----Original Message-----
> From: Martin D Bayly
> [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 15, 2001 10:00 AM
> To: [EMAIL PROTECTED]
> Subject: Enhanced errors tag
> 
> 
> 
> A useful enhancement to the <html:errors/> tag would
> be to have a single
> message
>  header/footer as well as an error block header and
> footer.
> This enables you to keep your message strings free
> of html markup such as
> the
> <li> shown in the examples.
> 
> eg.
> errors.header=<h3><font color="red">Validation
> Error</font></h3>You must
> correct
>  the following error(s) before proceeding:<ul>
> errors.footer=</ul><hr>
> 
> with the extension of:
> 
> error.header=<li>
> error.footer=</li>
> 
> 
> The attached is a version of our ErrorsTag (copied
> from the struts
> errorstag)
> incorporating this change
> 
> (See attached file: ErrorsTag.java)
> 
> Martin
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Reply via email to