Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Can anyone explain this Mock Question

 
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??
 
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
 
expectation is the root of all heartache - shakespeare. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic