This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SimpleTag allows body-content as JSP?  RSS feed

 
Hai Lin
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
Found another question in my mock exam for SCWCD 1.4

Problem:

*Given that a tag testlib:myFirstSimpleTag extends SimpleTagSupport. What should be done so that scriptlet code can be used in the body of this tag?

Options Select 1 correct option.

A, body-content should be set to JSP in the TLD for this tag.
B, scripting-enabled should be set to true in the TLD for this tag.
C, Create a classic tag adapter for this tag that has the body-content of JSP.
D, This cannot be done because it is a Simple tag.

My answer is D, since I think SimpleTag only allows Jsp fragment which should not have JSP script. But the answer notes says: A SimpleTag can also have JSP code in the body if configured correctly.

Thanks a lot for solving this puzzle.

Hai
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!