• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Need clarification on Ch. 10 mock question 17.

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Why is scripting disallowed in the body of simple and classic tag.

From I read in chapter 10, we can set the body content of simple and classic tag to JSP, empty, scriptless or tagindependant in TLD. Furthermore, tag directive can be defined to set the body content of tag file to empty, scriptless or tagindependant.

How come the correct answers to the question are A and C only?

Is the limitation written in the book or just in JSP spec?

Thanks and regards,

Connie
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I think because simple tags are going to handle the contents of the body as JSP Fragments since scripting is not allowed in JSPFragments it is not allowed in simple tags.But in Classic tags bodycontent object is used to handle the contents so i think JSP is allowed in classic tags.


Please correct me If I am wrong.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Connie,

Please don't forget to say something when somebody answered your questions
A simple "thanks" will tell us that you've seen our replies.
You've never replied in any of your posts.
 
Connie Ky Leung
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.
 
Connie Ky Leung
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read the API of JSPFragement class and JSPFramenet cannot contain scriptlets and scriptlet expression. Thanks for pointing it out in the previous post.

I will verify whether or not classic tag can handle scriptlet and scriplet expressions in its body some other time.

Thanks.
 
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we put body-content as JSP for simple tags?

Please look at this exception...

"The TLD for the class TagTest.FirstTag specifies an invalid body-content (JSP) for a SimpleTag"

Request anyone to clarify.
 
Connie Ky Leung
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I saw error message of this nature while coding tags for practice. Is it related to the web container we are using. I am using Tomcat 5.0.28.

Regards,

Connie
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont think so.....mine is Tomcat 5.0.16.

'JSP' is an invalid body-content for simple tags.

Please confirm this.

Thanks
 
Connie Ky Leung
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried a simple exercise last night and I could specify JSP body content for classic tag in TLD. I suppose JSP is invalid for simple tag.

Regards,
Connie
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The possible body content values for simple tags,

scriptless(default)
tagdependent
empty


The possible body content values for classic tags,

JSP (Default)
tagdependent
empty.
 
Connie Ky Leung
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the further clarification.
 
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic