• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jsp Tag Question

 
Andy Smith
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I Came across this question in one of the J2EECertification.com exam
Which of the following are valid declarations in a JSP page? [Check all correct answers]
The correct answer is:
1. <jsp:getProperty Name="id" Property="streetName"/>
2. <jsp:getProperty property="streetName" name="id"></jsp:getProperty>
3. <jsp:getProperty name="id" class="com.baboon.scwcd.Address" property="streetName"/>
4. <jsp:getProperty name="id" property="streetName"/>
5. <jsp:getProperty property="streetName" name="id"/>
I answered 2,4,5
but the sites says the correct answers are 4,5
Is the option 2 invalid? if yes then y so?
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP tag syntax does not permit for opening and closing tags with jsp:getProperty. You must provide a single tag that is 'self-closing.' Option 2 is therefore invalid syntax.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic