aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes SCWCD prep Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "SCWCD prep Doubt" Watch "SCWCD prep Doubt" New topic
Author

SCWCD prep Doubt

Ajay Kumar Sharma
Greenhorn

Joined: Jun 18, 2011
Posts: 4

In a JSP-centric shopping cart application, you need to move a client's home address of the Customer object into the shipping address of the Order object. The address data is stored in a value object class called Address with properties for: street address, city, province, country, and postal code. Which two JSP code snippets can be used to accomplish this goal? (Choose two.)

A. <c:set var='order' property='shipAddress' value='${client.homeAddress}' />

B. <c:set target='${order}' property='shipAddress' value='${client.homeAddress}' />

C. <jsp:setProperty name='${order}' property='shipAddress' value='${client.homeAddress}' />

D. <c:set var='order' property='shipAddress'>

<jsp:getProperty name='client' property='homeAddress' />

</c:store>

E. <c:set target='${order}' property='shipAddress'>

<jsp:getProperty name='client' property='homeAddress' />

</c:set>

F. <c:setProperty name='${order}' property='shipAddress'>

<jsp:getProperty name='client' property='homeAddress' />

</c:setProperty>

Why "C" AND "F" is not the answer..?

Ans is given as: B and E
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5593
    
  14

QuoteYourSources please.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Ajay Kumar Sharma
Greenhorn

Joined: Jun 18, 2011
Posts: 4

Taken it from same community.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3858

Ajay Kumar Sharma wrote:Taken it from same community.

You may need to specific about the source (book, web link etc...).

And welcome to CodeRanch!


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1731
    
  25

the topic came from here: old thread

but it lacks the source..

Regards,
Frits
Ajay Kumar Sharma
Greenhorn

Joined: Jun 18, 2011
Posts: 4

Hi Guys

What i think is E can't be the Ans. Because <jsp:getProperty name='client' property='homeAddress' /> will return address as string and we can't give address a string value
Hermann Laghom
Greenhorn

Joined: May 28, 2011
Posts: 18

i think C and F are not correct because the name attribute is taking an EL expression. it will work if you put 'order'


OCJP 6, OCE JEE6 JSP and Servlets Developer
Ajay Kumar Sharma
Greenhorn

Joined: Jun 18, 2011
Posts: 4

Hermann Laghom wrote:i think C and F are not correct because the name attribute is taking an EL expression. it will work if you put 'order'


Yeh That i Got. But What about 'E'
Hermann Laghom
Greenhorn

Joined: May 28, 2011
Posts: 18

As you know will return the homeAddress value of the "client" object
and the c:set action will call the setter method of the property shipAddress. We have no information about this method, so i think it could be something like
who takes a string argument and could create an object Address.
 
 
subject: SCWCD prep Doubt