struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruben Cepeda" <ruben_cep...@hotmail.com>
Subject RE: Counting ActionErrors from JSP
Date Sun, 07 May 2006 00:58:46 GMT
Philihp,

If you want to get accesses to the ActionErrors class "size()" method from a 
JSP thru lets say JSTL.  You will can extend the ActionErrors and makes the 
method "getSize()".  The access the ActionErrors class in the page my its 
name (see http://struts.apache.org/struts-doc-1.2.x/api/index.html for name 
details).  Anyways I don't know it this is a possible solution to you.  So 
you might try the following scriptlet.

<%
  int count =
     ((ActionErrors) 
pageContext.findAttribute(org.apache.struts.Globals.ERROR_KEY)).size();
%>

Let the list know if any of this helped.

*************************************
Ruben Cepeda
ruben_cepeda@hotmail.com
*************************************



----Original Message Follows----
From: "Philihp Busby" <philihp@gmail.com>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: user@struts.apache.org
Subject: Counting ActionErrors from JSP
Date: Fri, 5 May 2006 20:45:24 -0400

Hi Struts List,

Is there a way through Struts and JSTL Tags to get a "count" of the
number of ActionMessages or ActionErrors?

I would like my <html:messages> to display messages in a numbered
bulleted list when there are more than one, but just display the one
outside of a list when there is only one.

Thanks,
Philihp



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


Mime
View raw message