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

SimpleTag allows body-content as JSP?

 
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic