Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 30241 invoked from network); 5 Oct 2009 16:20:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Oct 2009 16:20:26 -0000 Received: (qmail 9176 invoked by uid 500); 5 Oct 2009 16:20:23 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 9148 invoked by uid 500); 5 Oct 2009 16:20:23 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 9138 invoked by uid 99); 5 Oct 2009 16:20:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Oct 2009 16:20:23 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Oct 2009 16:20:13 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MuqHw-0005W0-Ad for user@struts.apache.org; Mon, 05 Oct 2009 09:19:52 -0700 Message-ID: <25753802.post@talk.nabble.com> Date: Mon, 5 Oct 2009 09:19:52 -0700 (PDT) From: "SanJ.SANJAY" To: user@struts.apache.org Subject: Re: Struts 1 new bean in form. In-Reply-To: <5e5424000910050859o6a39698t22ad0fd30b4a1b4f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: girish.sh@gmail.com References: <25753281.post@talk.nabble.com> <5e5424000910050859o6a39698t22ad0fd30b4a1b4f@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org I am setting this new bena in form like this: private NewBean omg=3D new NewBean (); public NewBean getOmg() { return omg; } public void setOmg(NewBean omg) { this.omg=3D omg; } Now I have the instance of bean (omg) in my form. So to call the properties inside omg, I call in jsp like this for which i get server error saying no getter method for the bean=20 Pawe=C5=82 Wielgus wrote: >=20 > Hi, > where are You setting this bean into form? > Try < bean:write name=3D"myForm" property=3D"omg" /> > in jsp, it might be null. >=20 > Best greetings, > Pawe=C5=82 Wielgus. >=20 >=20 > 2009/10/5 SanJ.SANJAY : >> >> Hello, >> >> =C2=A0 =C2=A0 =C2=A0 I am using Struts 1. I am having some issue with cr= eating a new >> bean >> inside the form. >> >> I have JSP with its form. Now I need to add a feature in my same JSP >> page. >> With this feature will come lots of new fields in JSP. So I thought >> instead >> of writing the fields and getter/setters in the same form, I will create >> a >> new bean where I will define all these new fields and getters/setters an= d >> then I will instantiate that bean in my form and read those fields in >> JSP. >> But JSP is not able to read thos fields. The part of code is below. >> >> JSP: >> >> >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> >>
OSP: >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0
>> >> This si only one field, but similarly there are set of other fields whic= h >> I >> have not mentioned. >> >> I have a new bean with getters/setters for these new set of fields and I >> instantiate that bean in my form like this: >> >> =C2=A0private NewBean omg=3D new NewBean (); >> >> =C2=A0 =C2=A0public NewBean getOmg() { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return omg; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0public void setOmg(NewBean omg) { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0this.omg=3D omg; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> >> NewBean.java : >> >> private String =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0alocation =3D ""; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0public String getAlocation() { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return alocationO= SP; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0public void setAlocation(String alocationOSP)= { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0this.alocationOSP= =3D alocationOSP; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> Any pointers what could be the issue here? >> >> The error message I am getting is: >> No getter method found for this bean omg.alocation >> -- >> View this message in context: >> http://www.nabble.com/Struts-1-new-bean-in-form.-tp25753281p25753281.htm= l >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> For additional commands, e-mail: user-help@struts.apache.org >> >> >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org >=20 >=20 >=20 --=20 View this message in context: http://www.nabble.com/Struts-1-new-bean-in-fo= rm.-tp25753281p25753802.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org