You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ha...@informatiefabriek.nl on 2003/04/11 14:20:27 UTC

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/localhost/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/localhost/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/localhost/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


Re: Help with iterator (solved!)

Posted by ha...@informatiefabriek.nl.
Hi,

I put the class into a package and used the fully qualified name. Now it 
works!

Thanks, great help guys!

Bye, 

Harm.




harm@informatiefabriek.nl 
04/11/2003 02:35 PM
Please respond to
"Struts Users Mailing List" <st...@jakarta.apache.org>


To
"Struts Users Mailing List" <st...@jakarta.apache.org>
cc

Subject
Re: Help with iterator






Thanks for the suggestion.

But, because this is a testing project, I did not put it in any package.
So, as far as I can tell this is the fully qualified name.

Should I have to put it in a package?

Gr. Harm.




Deepak <de...@hotpop.com> 
04/11/2003 02:35 PM
Please respond to
"Struts Users Mailing List" <st...@jakarta.apache.org>


To
"Struts Users Mailing List" <st...@jakarta.apache.org>
cc

Subject
Re: Help with iterator






try giving the fully qualified name of the bean

On Friday 11 April 2003 05:50 pm, you wrote:
> 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/localhost/
>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/localhost/
>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/localhost/
>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




---------------------------------------------------------------------
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


Re: Help with iterator

Posted by ha...@informatiefabriek.nl.
Thanks for the suggestion.

But, because this is a testing project, I did not put it in any package.
So, as far as I can tell this is the fully qualified name.

Should I have to put it in a package?

Gr. Harm.




Deepak <de...@hotpop.com> 
04/11/2003 02:35 PM
Please respond to
"Struts Users Mailing List" <st...@jakarta.apache.org>


To
"Struts Users Mailing List" <st...@jakarta.apache.org>
cc

Subject
Re: Help with iterator






try giving the fully qualified name of the bean

On Friday 11 April 2003 05:50 pm, you wrote:
> 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/localhost/
>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/localhost/
>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/localhost/
>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




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


Re: Help with iterator

Posted by Deepak <de...@hotpop.com>.
try giving the fully qualified name of the bean

On Friday 11 April 2003 05:50 pm, you wrote:
> 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/localhost/
>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/localhost/
>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/localhost/
>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


RE: Help with iterator

Posted by Robert Taylor <rt...@mulework.com>.
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