I have found that avoiding <html:errors/> all together helps keep your html
in the JSPs instead of properties files.  I used <html:messages ..> instead
and ended up with something like this:

       <logic:messagesPresent>
         <table class="message">
           <tr><td><bean:message key="errors.html.message.header
"/></td></tr>
           <html:messages id="error" message="false">
             <tr><td><font color="red"><b>*</b> <bean:write
name="error"/></font></td></tr>
           </html:messages>
         </table>
       </logic:messagesPresent>

Then I also have something in a differnet markup language as well, if you
ever need something similar (this is for WML):

   <logic:messagesPresent>
     <html:messages id="error" message="false">
       <p><bean:write name="error"/></p>
     </html:messages>
   </logic:messagesPresent>


On 6/22/06, Givler, Eric <[EMAIL PROTECTED]> wrote:

Couldn't you do something like this:

<c:set var="errorQuantity">
   <html:errors property="quantity_display" />
</c:set>

Then you can interrogate that variable later as it contains the contents
of the error for the field in question.  If no errors, it is empty.

<c:choose>
   <c:when test="${not empty errorQuantity}" >
         // do something here
   </c:when>
   <c:otherwise>
         // else do something else
   </c:otherwise>
</c:choose>

or use a <c:if>

-----Original Message-----
From: Dhanasekaran Vivekanandhan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 21, 2006 4:23 AM
To: Struts Users Mailing List
Subject: How to check for error message in jsp


Hi,
I am using <html:errors/> in the jsp page and using
date validator plugin ,and it is showing error message
as mentioned in the MessageResources.properties
file.My question is I want to show ,hide some fields
in the jsp page if error is occured.How to check in
the jsp page if there is any error occured.
any help would be appreciated
tia,
dhanasekaran

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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


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


Reply via email to