I used <jsp:useBean id="operson" class="Person" scope="request" > <jsp:setProperty name="operson" property="name" value="hi" Scope="request" /> <jsp:getProperty name="operson" property="name" Scope="request" /> </jsp:useBean>
But Tomcat throws up an Jsp Compile Time Error saying invalid attribute Scope in jsp:get and jsp:set tags that means we cant specify the Scope Attribute for these tags.
But in HFSJ page number 355 it is stated that the default scope for <jsp:useBean> and <jsp:getProperty> is Page scope I checked Errata nothing is specified about this.
I think we cant have scope attribute specified in the <jsp:setProperty> and <jsp:getProperty> tags.
Joined: Aug 06, 2007
There is scope attribute for the setProperty nor getProperty. you introduce the bean using useBean and there you specify the scope. Now whenever you se/get a property, you will be working on a bean that you have introduced using the useBean. i.e there is no point in having the scope again for get/set properties.
SCBCD - SCWCD - SCJD - SCJP - OCA
Joined: May 08, 2007
Hi raja ram
i think in your code as per you have shown just note overhere:
May be this is leading to compiler error see below:>
and what Musab Al-Rawi said is absolutely correct there is no point in giving scope while setting and getting properties,since we already decide the Bean scope in UseBean Tag.
I hope it help you to some extent.
SCJP(1.5),SCWCD(On the Way...) Dhwani:>Winning is not important but it is the only thing. [ May 06, 2008: Message edited by: dhwani mathur ]