permaculture playing cards*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Need clarification on Ch. 10 mock question 17. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Need clarification on Ch. 10 mock question 17." Watch "Need clarification on Ch. 10 mock question 17." New topic
Author

Need clarification on Ch. 10 mock question 17.

Connie Ky Leung
Ranch Hand

Joined: Jan 29, 2006
Posts: 42
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


SCJP 1.4 - 91%, SCWCD - 97%, SCJP 5.0 - 83%, SCJP 6.0, OCEJWCD - 80%
Senthil Nathan.s
Greenhorn

Joined: Jan 04, 2006
Posts: 11
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.


with regards<br />s.senthilNathan<br />PH:9819194691
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.


[My Blog]
All roads lead to JavaRanch
Connie Ky Leung
Ranch Hand

Joined: Jan 29, 2006
Posts: 42
Thanks for the reply.
Connie Ky Leung
Ranch Hand

Joined: Jan 29, 2006
Posts: 42
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.
MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
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.


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Connie Ky Leung
Ranch Hand

Joined: Jan 29, 2006
Posts: 42
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

Joined: Oct 09, 2003
Posts: 517
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

Joined: Jan 29, 2006
Posts: 42
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

Joined: Oct 09, 2003
Posts: 517
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

Joined: Jan 29, 2006
Posts: 42
thanks for the further clarification.
 
jQuery in Action, 2nd edition
 
subject: Need clarification on Ch. 10 mock question 17.
 
Similar Threads
Default value for body content
Scripting Elements in Simple Tag
scripts in tags
JspFragment
allowable body-content values