struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asif Rahman" <arah...@worlddata.com>
Subject [SOLVED] Re: Problem with displaying a subset of error messages using <html:messages>
Date Thu, 24 Jun 2004 20:58:09 GMT
It works! I just got it to work the same way
too:http://javaboutique.internet.com/tutorials/excep_struts/index-2.html
Thanks so much Atta  :)

-Asif

----- Original Message ----- 
From: "atta-ur rehman" <attar@numetrics.com>
To: "Struts Users Mailing List" <user@struts.apache.org>; "Asif Rahman"
<arahman@worlddata.com>
Sent: Thursday, June 24, 2004 4:56 PM
Subject: Re: Problem with displaying a subset of error messages using
<html:messages>


> Okay, while out for lunch i thought about it and i think the right way of
> doing it would be to use "property" attribute of the <html:messages> tag:
>
> http://jakarta.apache.org/struts/userGuide/struts-html.html#messages
>
> henc new code:
>
> <logic:messagesPresent>
>    <html:messages id="error" property="company">
>       <li><bean:write name="error"/></li>
>    </html:messages>
>   <br><br>
> </logic:messagesPresent>
>
> I wish i could have been able to check it but let's see if it works!
>
> ATTA
>
> ----- Original Message ----- 
> From: "Asif Rahman" <arahman@worlddata.com>
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Sent: Thursday, June 24, 2004 1:26 PM
> Subject: Re: Problem with displaying a subset of error messages using
> <html:messages>
>
>
> > Hi Atta,  this is what I'm getting when I try that:
> >
> > javax.servlet.jsp.JspTagException: javax.servlet.jsp.JspException: An
> error
> > occurred while evaluating custom action attribute "test" with value
> > "${error.key == 'company'}": Unable to find a value for "key" in object
of
> > class "java.lang.String" using operator "." (null)
> >  at
> org.apache.taglibs.standard.tag.el.core.IfTag.condition(IfTag.java:102)
> >
> > Any ideas?
> >
> > -Asif
> >
> > ----- Original Message ----- 
> > From: "atta-ur rehman" <attar@numetrics.com>
> > To: "Struts Users Mailing List" <user@struts.apache.org>; "Asif Rahman"
> > <arahman@worlddata.com>
> > Sent: Thursday, June 24, 2004 4:04 PM
> > Subject: Re: Problem with displaying a subset of error messages using
> > <html:messages>
> >
> >
> > > 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" <arahman@worlddata.com>
> > > To: "Struts Users Mailing List" <user@struts.apache.org>
> > > 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: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message