• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SCWCD prep Doubt

 
Greenhorn
Posts: 4
Eclipse IDE Windows Vista Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
QuoteYourSources please.
 
Ajay Kumar Sharma
Greenhorn
Posts: 4
Eclipse IDE Windows Vista Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Taken it from same community.
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the topic came from here: old thread

but it lacks the source..

Regards,
Frits
 
Ajay Kumar Sharma
Greenhorn
Posts: 4
Eclipse IDE Windows Vista Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 18
Mac PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think C and F are not correct because the name attribute is taking an EL expression. it will work if you put 'order'
 
Ajay Kumar Sharma
Greenhorn
Posts: 4
Eclipse IDE Windows Vista Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 18
Mac PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
PI day is 3.14 (march 14th) and is also einstein's birthday. And this is merely a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic