Page 1 of 1

About Question enthuware.jwpv6.2.1137 :

Posted: Tue Apr 30, 2013 2:23 am
by sebastien
Hello,


for the 3rd answer, the explanation is not correct :
This will not work because the parameter name and the property name do not match.
this will not work because ther is no attribute value or param.

to match parameters's names with property of bean we should have :
<jsp:useBean id='prd' scope='request' class='com.enthu.Product' >
<jsp:setProperty name='prd' property='*'/>
</jsp:useBean>
tell me if i'm wrong

Re: About Question enthuware.jwpv6.2.1137 :

Posted: Fri May 03, 2013 6:46 am
by admin
You are wrong. The given explanation is correct. Please see this:
http://docs.oracle.com/cd/A97336_01/bus ... tm#1008181
Or, if the bean property and request parameter have the same name (user), you can simply set the property as follows:

<jsp:setProperty name="pageBean" property="user" />
-Paul.

Re: About Question enthuware.jwpv6.2.1137 :

Posted: Mon Jan 05, 2015 4:48 am
by targetOCE
Just a side note. Not sure if my understanding is correct here. However, the Product class doesn't comply to the basic requirements to be eligible as a Bean and be used in jsp:useBean tag as it doesn't has a public no-arg constructor, unless in this case, it uses the default constructor?

Re: About Question enthuware.jwpv6.2.1137 :

Posted: Mon Jan 05, 2015 10:24 am
by admin
Yes, it is a valid bean. It is provided with a no-args constructor by the compiler automatically.

Re: About Question enthuware.jwpv6.2.1137 :

Posted: Mon Jan 05, 2015 11:28 am
by targetOCE
ok, the default constructor. thanks