Forums Register Login

Need clarification on Ch. 10 mock question 17.

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Thanks for the reply.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
I dont think so.....mine is Tomcat 5.0.16.

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

Please confirm this.

Thanks
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
The possible body content values for simple tags,

scriptless(default)
tagdependent
empty


The possible body content values for classic tags,

JSP (Default)
tagdependent
empty.
+Pie Number of slices to send: Send
thanks for the further clarification.
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 990 times.
Similar Threads
Default value for body content
scripts in tags
Scripting Elements in Simple Tag
allowable body-content values
JspFragment
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:17:31.