struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Taylor" <rtay...@mulework.com>
Subject RE: Help with iterator
Date Fri, 11 Apr 2003 12:28:01 GMT
Is AdvertisementForm the fully qualified class name?
Make sure and use the fully qualified class name in the
type attribute of the logic:iterate element.

robert

> -----Original Message-----
> From: harm@informatiefabriek.nl [mailto:harm@informatiefabriek.nl]
> Sent: Friday, April 11, 2003 8:20 AM
> To: struts-user@jakarta.apache.org
> Subject: Help with iterator
>
>
> Hi all,
>
> I'm developing an application using struts.
>
> In my Action (OverViewAction.java) I fill a Vector with AdvertisementForm
> beans like this:
>
> // .. some other code
> Vector formbeans = new Vector();
> Iterator it = col.iterator();
> while (it.hasNext()) {
>         AdvertisementForm formbean = new AdvertisementForm();
>         AdvertisementValue valueObj = (AdvertisementValue) it.next();
>         formbean.setSerial(valueObj.getSerial());
>         formbean.setStatus("" + valueObj.getStatus());
>         formbeans.add(formbean);
> }
> request.getSession().setAttribute("advertisements", formbeans);
> return (mapping.findForward("overview"));
>
>
> Then in my JSP I use this code to iterate through the advertisements
> collection:
>
> <logic:iterate id="advertisement" name="advertisements" type=
> "AdvertisementForm">
>         <bean:write name="advertisement" property="serial"/>
> </logic:iterate>
>
>
> Then I get the following compiler Exception(s) when I try to view my JSP.
> Can you guys tell me what's wrong here?
>
>
> rg.apache.jasper.JasperException: Unable to compile class for JSP
>
> An error occurred at line: 168 in the jsp file: /main.jsp
>
> Generated servlet error:
>     [javac] Compiling 1 source file
>
> /usr/java/jboss-3.0.6_tomcat-4.1.18/tomcat-4.1.x/work/MainEngine/l
> ocalhost/struts-example/main_jsp.java:312:
> cannot resolve symbol
> symbol  : class AdvertisementForm
> location: class org.apache.jsp.main_jsp
>                 AdvertisementForm advertisement = null;
>                 ^
>
>
>
> An error occurred at line: 168 in the jsp file: /main.jsp
>
> Generated servlet error:
> /usr/java/jboss-3.0.6_tomcat-4.1.18/tomcat-4.1.x/work/MainEngine/l
> ocalhost/struts-example/main_jsp.java:319:
> cannot resolve symbol
> symbol  : class AdvertisementForm
> location: class org.apache.jsp.main_jsp
>                   advertisement = (AdvertisementForm)
> pageContext.findAttribute("advertisement");
>                                    ^
>
>
>
> An error occurred at line: 168 in the jsp file: /main.jsp
>
> Generated servlet error:
> /usr/java/jboss-3.0.6_tomcat-4.1.18/tomcat-4.1.x/work/MainEngine/l
> ocalhost/struts-example/main_jsp.java:327:
> cannot resolve symbol
> symbol  : class AdvertisementForm
> location: class org.apache.jsp.main_jsp
>                   advertisement = (AdvertisementForm)
> pageContext.findAttribute("advertisement");
>                                    ^
> 3 errors
>
> Thanks a million,
>
> Harm de Laat
> Informatiefabriek
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Mime
View raw message