RE: NewBie:Populating objects in Jsp
Do you have a getter method for your upn property ? It should be getUpn() Steve (I've copied this back to the list, you should send messages there for better response times) -Original Message- From: sushil jain [mailto:[EMAIL PROTECTED] Sent: July 4, 2003 12:37 AM To: Nicolas De Loof; [EMAIL PROTECTED] Subject: Re: NewBie:Populating objects in Jsp Thanks for the reply . I have made the changes but now iam getting the following error :- org.apache.jasper.JasperException: No getter method for property upn of bean pupil As suggested I have made the following changes in the APFM02.jsp:- Regards Sushil Nicolas De Loof <[EMAIL PROTECTED]> wrote: Yeah, I get the first point ! Are you ready for the next question ? Nico. > Nicolas obviously types quicker then me :-) > > Steve > > > -Original Message- > > From: Nicolas De Loof [mailto:[EMAIL PROTECTED] > > Sent: July 3, 2003 11:45 PM > > To: Struts Users Mailing List > > Subject: Re: NewBie:Populating objects in Jsp > > > > > > 1. > > type attribute is uses to set the java type of a > > JSP variable set by the tag for current item. By > > default type is java.lang.Object, and if you don't use scriptlets > > () or Runtime Expression () you > > don't need to use it. > > > > In the case you want to use type attribute, JSP has to import > > type declaration using a JSP directive . > > > > In your case, I don't think PUPIL_LIST items are APFM01Action instances. > > > > 2. > > id attribute is used to set the name of a JSP variable and a page > > scoped bean for the current item. In your case, it > > should be a "pupil", not a "pupilList". > > > > > > > > Nico. > > > > > The APFM02.jsp code is as follows :- > > > > > > > > > > > > > > > > > > > > > > > > > > > and the Struts-config file is as follows :- > > > > > > > > > type="APFM01Form"/> > > > > > > type="APFM02Form"/> > > > > > > > > > > > > > > > > > > type="APFM01Action" > > > name="APFM01Form" > > > input="/APFM01.jsp" > > > scope="session"> > > > > > > > > > > > > > > > type="APFM02Action" > > > name="APFM02Form" > > > scope="request"> > > > > > > > > > Thanks > > > Sushil > > > > > > > > > - > > > Do you Yahoo!? > > > SBC Yahoo! DSL - Now only $29.95 per month! > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NewBie:Populating objects in Jsp
Yeah, I get the first point ! Are you ready for the next question ? Nico. > Nicolas obviously types quicker then me :-) > > Steve > > > -Original Message- > > From: Nicolas De Loof [mailto:[EMAIL PROTECTED] > > Sent: July 3, 2003 11:45 PM > > To: Struts Users Mailing List > > Subject: Re: NewBie:Populating objects in Jsp > > > > > > 1. > > type attribute is uses to set the java type of a > > JSP variable set by the tag for current item. By > > default type is java.lang.Object, and if you don't use scriptlets > > (<% java %>) or Runtime Expression (<%= java %>) you > > don't need to use it. > > > > In the case you want to use type attribute, JSP has to import > > type declaration using a JSP directive <% @page > > import="" %>. > > > > In your case, I don't think PUPIL_LIST items are APFM01Action instances. > > > > 2. > > id attribute is used to set the name of a JSP variable and a page > > scoped bean for the current item. In your case, it > > should be a "pupil", not a "pupilList". > > > > > > > > Nico. > > > > > The APFM02.jsp code is as follows :- > > > > > > > > > > > > > > > > > > > > > > > > > > > and the Struts-config file is as follows :- > > > > > > > > type="APFM01Form"/> > > > > > type="APFM02Form"/> > > > > > > > > > > > > > > > > >type="APFM01Action" > > > name="APFM01Form" > > > input="/APFM01.jsp" > > > scope="session"> > > > > > > > > > > > >> >type="APFM02Action" > > > name="APFM02Form" > > > scope="request"> > > > > > > > > > Thanks > > > Sushil > > > > > > > > > - > > > Do you Yahoo!? > > > SBC Yahoo! DSL - Now only $29.95 per month! > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: NewBie:Populating objects in Jsp
Nicolas obviously types quicker then me :-) Steve > -Original Message- > From: Nicolas De Loof [mailto:[EMAIL PROTECTED] > Sent: July 3, 2003 11:45 PM > To: Struts Users Mailing List > Subject: Re: NewBie:Populating objects in Jsp > > > 1. > type attribute is uses to set the java type of a > JSP variable set by the tag for current item. By > default type is java.lang.Object, and if you don't use scriptlets > (<% java %>) or Runtime Expression (<%= java %>) you > don't need to use it. > > In the case you want to use type attribute, JSP has to import > type declaration using a JSP directive <% @page > import="" %>. > > In your case, I don't think PUPIL_LIST items are APFM01Action instances. > > 2. > id attribute is used to set the name of a JSP variable and a page > scoped bean for the current item. In your case, it > should be a "pupil", not a "pupilList". > > > > Nico. > > > The APFM02.jsp code is as follows :- > > > > > > > > > > > > > > > > > > and the Struts-config file is as follows :- > > > > > type="APFM01Form"/> > > > type="APFM02Form"/> > > > > > > > > > > >type="APFM01Action" > > name="APFM01Form" > > input="/APFM01.jsp" > > scope="session"> > > > > > > > >>type="APFM02Action" > > name="APFM02Form" > > scope="request"> > > > > > > Thanks > > Sushil > > > > > > - > > Do you Yahoo!? > > SBC Yahoo! DSL - Now only $29.95 per month! > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: NewBie:Populating objects in Jsp
See below... > -Original Message- > From: sushil jain [mailto:[EMAIL PROTECTED] > Sent: July 3, 2003 11:26 PM > To: Struts Users Mailing List > Subject: NewBie:Populating objects in Jsp > > > Hello, > I am new to struts and Jsp and facing a very basic problem :- > The requirement is that on submit of APFM01.jsp page I do some > business processing and populate a ArrayList in the action Class > APFM01Action. Now I want to display the contents of the ArrayList > as table in the second page APFM02.jsp. I am trying to do so by > using the iterate tag in the APFM02.jsp but getting the following > errors :- > Since fork is true, ignoring compiler setting. > [javac] Compiling 1 source file > [javac] Since fork is true, ignoring compiler setting. > [javac] > E:\jakarta-tomcat-4.1.24\work\Standalone\localhost\myProject\APFM0 > 2_jsp.java:424: cannot resolve symbol > [javac] symbol : class APFM01Action > [javac] location: class org.apache.jsp.APFM02_jsp > [javac] APFM01Action pupilList = null; > [javac] ^ > [javac] > E:\jakarta-tomcat-4.1.24\work\Standalone\localhost\myProject\APFM0 > 2_jsp.java:431: cannot resolve symbol > [javac] symbol : class APFM01Action > [javac] location: class org.apache.jsp.APFM02_jsp > [javac] pupilList = (APFM01Action) > pageContext.findAttribute("pupilList"); > [javac] ^ > [javac] > E:\jakarta-tomcat-4.1.24\work\Standalone\localhost\myProject\APFM0 > 2_jsp.java:457: cannot resolve symbol > [javac] symbol : class APFM01Action > [javac] location: class org.apache.jsp.APFM02_jsp > [javac] pupilList = (APFM01Action) > pageContext.findAttribute("pupilList"); > [javac]^ > [javac] 3 errors > > In the APFM01Action class Iam doing the following :- > > SAXParser myParser = new MySAXParser(); > myParser.ParseXML(browse); > ArrayList pupilList= myParser.listPupil(); > request.setAttribute("PUPIL_LIST",pupilList); > return(mapping.findForward("success")); > > The APFM02.jsp code is as follows :- > > Type should be the type of object that is your List (e.g. Pupil) , not the Action type. You probably don't even need to specify a type here because will use introspection to access the properties. Incidentally, 'pupil' might be a better value for the id because you are only accessing a single pupil in each iteration, not a list. > > > > > > > and the Struts-config file is as follows :- > > type="APFM01Form"/> > type="APFM02Form"/> > > > > > type="APFM01Action" > name="APFM01Form" > input="/APFM01.jsp" > scope="session"> > > > > type="APFM02Action" > name="APFM02Form" > scope="request"> > > > Thanks > Sushil > > > - > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NewBie:Populating objects in Jsp
1. type attribute is uses to set the java type of a JSP variable set by the tag for current item. By default type is java.lang.Object, and if you don't use scriptlets (<% java %>) or Runtime Expression (<%= java %>) you don't need to use it. In the case you want to use type attribute, JSP has to import type declaration using a JSP directive <% @page import="" %>. In your case, I don't think PUPIL_LIST items are APFM01Action instances. 2. id attribute is used to set the name of a JSP variable and a page scoped bean for the current item. In your case, it should be a "pupil", not a "pupilList". Nico. > The APFM02.jsp code is as follows :- > > > > > > > > > and the Struts-config file is as follows :- > > type="APFM01Form"/> > type="APFM02Form"/> > > > > > type="APFM01Action" > name="APFM01Form" > input="/APFM01.jsp" > scope="session"> > > > > type="APFM02Action" > name="APFM02Form" > scope="request"> > > > Thanks > Sushil > > > - > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
NewBie:Populating objects in Jsp
Hello, I am new to struts and Jsp and facing a very basic problem :- The requirement is that on submit of APFM01.jsp page I do some business processing and populate a ArrayList in the action Class APFM01Action. Now I want to display the contents of the ArrayList as table in the second page APFM02.jsp. I am trying to do so by using the iterate tag in the APFM02.jsp but getting the following errors :- Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] E:\jakarta-tomcat-4.1.24\work\Standalone\localhost\myProject\APFM02_jsp.java:424: cannot resolve symbol [javac] symbol : class APFM01Action [javac] location: class org.apache.jsp.APFM02_jsp [javac] APFM01Action pupilList = null; [javac] ^ [javac] E:\jakarta-tomcat-4.1.24\work\Standalone\localhost\myProject\APFM02_jsp.java:431: cannot resolve symbol [javac] symbol : class APFM01Action [javac] location: class org.apache.jsp.APFM02_jsp [javac] pupilList = (APFM01Action) pageContext.findAttribute("pupilList"); [javac] ^ [javac] E:\jakarta-tomcat-4.1.24\work\Standalone\localhost\myProject\APFM02_jsp.java:457: cannot resolve symbol [javac] symbol : class APFM01Action [javac] location: class org.apache.jsp.APFM02_jsp [javac] pupilList = (APFM01Action) pageContext.findAttribute("pupilList"); [javac]^ [javac] 3 errors In the APFM01Action class Iam doing the following :- SAXParser myParser = new MySAXParser(); myParser.ParseXML(browse); ArrayList pupilList= myParser.listPupil(); request.setAttribute("PUPIL_LIST",pupilList); return(mapping.findForward("success")); The APFM02.jsp code is as follows :- and the Struts-config file is as follows :- Thanks Sushil - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month!