• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can anyone explain this Mock Question

 
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic