About Question enthuware.jwpv6.2.685 :

Moderator: admin

Post Reply
ETS User

About Question enthuware.jwpv6.2.685 :

Post by ETS User »

Should the answer be it will not compile since were trying to use a bean having a public constructor as shown in the exhibit?

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.685 :

Post by admin »

No, why do you think having a public constructor for a bean is a problem? A valid JavaBean bean should have a public constructor.

HTH,
Paul.

Siledh

Re: About Question enthuware.jwpv6.2.685 :

Post by Siledh »

It wouldn't compile or at least wouldn't work, because the <jsp:param> tag should be nested like that:

<jsp:useBean class="com.bookstore.Book" id="newbook" >
<jsp:setProperty name="newbook" property="isbn" value="1000"/>
</jsp:useBean>

And anyway, it would set the property only if the bean with "newbook" id hadn't been created earlier.

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.685 :

Post by admin »

The code in question uses setProperty and not setParam.

HTH,
Paul.

Siledh

Re: About Question enthuware.jwpv6.2.685 :

Post by Siledh »

Right, silly me. Thanks for the answer!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests