Try:

<c:set var="usernameError">
        <html:errors property="username"/>
</c:set>

<c:if test="${usernameError != null}">
        <tr><td><c:out value="${usernameError}"/></td></tr>
</c:if>

Or something similar.

Paul

> -----Original Message-----
> From: Robin Mannering [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 05, 2004 1:45 PM
> To: Struts Users Mailing List
> Subject: RE: ActionError and JSP display
> 
> 
> Hi,
> 
> 
> I was intending to use <html:errors property="username"/>, 
> specifying the property for display, but it still doesn't 
> allow me to test for it's existence.
> 
> 
> What I'd like to do is test if an error exists, then add a 
> new HTML table row and cell into the output containing the 
> error message, otherwise I do not want to create the HTML 
> table row and cell at all.
> 
> 
> Is there a way to do this ?
> 
> 
> Thanks
> 
> Robin
> 
> 
> -----Original Message-----
> 
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Jeff Beal
> 
> Sent: 05 October 2004 13:40
> 
> To: [EMAIL PROTECTED]
> 
> Subject: Re: ActionError and JSP display
> 
> 
> 
> Robin Mannering wrote:
> 
> > Hi,
> 
> > 
> 
> > 
> 
> > Platorm is : Tomcat 5, Struts 1.1
> 
> > 
> 
> > Context: HTML Form submissions and validation.
> 
> > 
> 
> > 
> 
> > I'm trying to conditionally test for the existince of error 
> messages by their keys.  And I'd then like to show the error 
> with HTML formatting around it.
> 
> > 
> 
> > 
> 
> > Basically, using tags, I'd like to do the same as the 
> following following pseudo code.
> 
> > 
> 
> > 
> 
> > if (errorMessage named 'usernameError' exists) {
> 
> > 
> 
> >     showError('usernameError' + some html)
> 
> > 
> 
> > }
> 
> > 
> 
> > 
> 
> > The error message is set from within the Form class as:
> 
> > 
> 
> > 
> 
> >     errors.add("usernameError", new 
> ActionError("errors.form.username.required"));
> 
> > 
> 
> > 
> 
> > I've been trawling around and have found lots of references 
> to <logic:messagesPresent> and then looping through each 
> message using <html:messages> but not a test for the 
> existence of a particular message.
> 
> > 
> 
> > 
> 
> > I'm trying to display the error message next to each 
> appropriate form element rather than in a list.  I probably 
> can't see the solution for looking.  Can anyone help?
> 
> > 
> 
> > 
> 
> > Many thanks
> 
> > 
> 
> > Robin
> 
> 
> Read 
> 
> http://struts.apache.org/api/org/apache/struts/taglib/html/pac
kage-summary.html#doc.Other.errors,

paying attention to the property attribute of html:errors


-- Jeff



====================================================================
This e-mail and any attachments may be confidential and/or legally
privileged. If you have received this e-mail and you are not a named
addressee, please inform Landmark Information Group on 01491 413030
and then delete the e-mail from your system. If you are not a named
addressee you must not use, disclose, distribute, copy, print or rely 
on this e-mail. This email and any attachments have been scanned for
viruses and to the best of our knowledge are clean. To ensure 
regulatory compliance and for the protection of our clients and 
business, we may monitor and read e-mails sent to and from our 
servers.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


**********************************************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**********************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to