• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can anyone explain this Mock Question

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From HFS chapter 10 question 17:

Given a tag, "simpleTag", whose handler is using SimpleTag and a tag, "complexTag", whose handler is using classic tag. Both tags are declared to be non-empty and non tagdependent in tld.

Which are valid use of these tags.

And this option (D) is invalid because of the scriptlet:
<my:simpleTag>
<my:complexTag>
<% i++; %>
</my:complexTag>
</my:simpleTag>

But why? SimpleTag body cannot be scriptlet but classic tag's body can be (look at the JSTL tag implementation from tomcat and they are in classic tag and declared to be <body-content>JSP</body-content>). So in above example, the body of <my:complexTag> should be allowed to have scriptlet!

Well, I do check this with Tomcat and above does really generate exception saying scriptlet is not allowed. I just dont understand why??
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

we discussed this one 2 week ago. Look the thread beneath:

Simple Tag & Classic Tag handler mock exam question - what's YOUR answer?

Regards,
Darya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic