Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Exam Question

 
Tridib Samanta
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the following question in a site:

Which of the following statements are true of custom tags that are created by extending the SimpleTagSupport class.
Choose one answer.
a. Such tags cannot manipulate the content of the body
b. Such tags cannot have a bodycontent type of JSP
c. Such tags do not need to be defined with a TLD file
d. Such tags may contain JSTL expressions within the body
e. Such tags cannot contain EL expressions within the body

Answer: d


I think option (b) is also correct. What is your opinion?
 
Abhishek Sharma
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you can have JSP as a body-content inside simple tags.
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think opinion comes into it. What happened when you attempted to create a custom tag that extended SimpleTagSupport and gave it a bodycontent type of JSP?
 
Tridib Samanta
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If "JSP" is specified as the body-content of SimpleTag, the following translation time error occurs:

an invalid body-content (JSP) for a SimpleTag.
 
Clifton Eaton
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
body content of jsp is not allowed in a SimpleTagSupport class the reason is that SimpleTagSupport cannot have scripting in the body. body content type of JSP allows for scripting. You can only have:

1. empty
2. tagdependent
3. scriptless
[ April 02, 2007: Message edited by: Clifton Eaton ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic