Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:getProperty

 
Selva Prasad Rajendran
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers

Do all these following 3 options mean the same of different.

1. <jsp:getProperty property="streetName" name="id"></jsp:getProperty>

2. <jsp:getProperty name="id" property="streetName"/>

3. <jsp:getProperty property="streetName" name="id"/>

Is that neccessary that jsp:getProperty should be a self closing tag.


-Selva
scjp 1.4
 
Daniel Rhoades
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getProperty must be a legal XML tag (i.e. it must be an empty tag - I think you called it self-closing, or it must have a closing tag) the order of the attributes doesn't matter.

BTW: You can also get these properties using EL:

${id.streetName}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic