This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

whats the diff

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi i am preparing for scwcd.i am reading hfsj book i am not clear with this plz some one explain me
<jsp:usebean id ="person" class = "foo.person" scope="request">
<jsp:setproperty name ="person" property=name value=fred"/>
</jsp:usebean>

and
<jsp:usebean id ="person" class = "foo.person" scope="request"/>
<jsp:setproperty name ="person" property=name value=fred"/>

what is the difference between two.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the different is, in the statement

<jsp:usebean id ="person" class = "foo.person" scope="request">
<jsp:setproperty name ="person" property=name value=fred"/>
</jsp:usebean>


because <jsp:setproperty name ="person" property=name value=fred"/>
in the body of <jsp:useBean.. then person.name is just assigned by Fred if bean person is not exist. imagine if person.name is already set from previos JSP or servlet and no need to overwriiten by new value.


But in this statement,

<jsp:usebean id ="person" class = "foo.person" scope="request">
<jsp:setproperty name ="person" property=name value=fred"/>


person.name is always write by 'Fred'. What happen if in person.name is already assign by 'Anshu'?. it will overwritten also, so yu will never get 'Anshu' in person.name after the statement.


Hope this help Anshu..

Joko
 
anshu sahai
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic