Hello Asif,

Now I havn't checked what I'm going to write here but am pretty sure it
should work.

First of all while adding your ActionError to ActionErrors use 'company' as
the key for the company errors and 'factory' for factory related error
messages.

like:

ActionErrors errors = new ActionErrors();
errors.add('company', new ActionError(....));
errors.add('factory', new ActionError(....));

now in you loop wrap you bean:wrie in an if statement:

<logic:messagesPresent>
     <html:messages id="error">
        <c:if test="${error.key == 'company'}">
            <li><bean:write name="error"/></li>
        </c:if>
     </html:messages>
  <br><br>
</logic:messagesPresent>


hope this work and helps!

ATTA

----- Original Message ----- 
From: "Asif Rahman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, June 24, 2004 12:48 PM
Subject: Problem with displaying a subset of error messages using
<html:messages>


Hi Im have been using pretty standard code to display error messages so far,
eg:

<logic:messagesPresent>
     <html:messages id="error">
        <li><bean:write name="error"/></li>
     </html:messages>
  <br><br>
</logic:messagesPresent>


But now, the problem I am facing is that I want to display a subset of my
error messages in one part of page, (e.g. Error messages that start with
"Company") and the rest of the messages (ones that start with "Factory") in
another section of the page.  I've read the docs but really havent been able
to figure this one out.  Can someone plese help me?  Thanks.

-Asif



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

Reply via email to