This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes default value of tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "default value of tag" Watch "default value of tag" New topic
Author

default value of tag

reubin haz
Ranch Hand

Joined: May 12, 2005
Posts: 287
I met a question asking what is the default value of the body-content attribute of a custom tag implementing the SimplyTag interface.

There are answers for all 4 types of values, and 2 more choices: Depends on the implementation; None of the above

The answer is "Depends on the implementation".

I chose "None of the above" since we know the specification has said it no longer defines the default value in JSP 2.0.

So isn't the answer "None of the above" is more appropriate? Or does "no longer defines the default value in JSP 2.0." means "Depends on the implementation"??


SCJA, SCJP5.0, SCBCD, SCWCD
Arvind Giri
Ranch Hand

Joined: Jun 26, 2005
Posts: 91
According to jsp 2.0 specs , default value of body-content is JSP(Page Number: 166(1-133)). and for tag directive it defaults to scriptless(Page Number: 196(1-163)).


Regards<br /> <br />Arvind Giri<br />MCA,SCJP 1.4,SCWCD 1.4<br />Looking for SCDJWS
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

reubin, I agree. It's written nowhere that it depends on the container. It only says that there's no default value anymore, and that "A reasonable default for simple tag handlers is "scriptless" if the tag can have a body"

I would have chosen "None of the above" too.


[My Blog]
All roads lead to JavaRanch
Arvind Giri
Ranch Hand

Joined: Jun 26, 2005
Posts: 91
Hey Satou,
Now I am confused. Could you please tell me where it is mentioned that there is no default value.
Please reply.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

JSP2.0 specification, 3-29
JSP.C.1 XML Schema for TLD, JSP 2.0.
page 413 of the PDF file.
Rahul Jadaun
Ranch Hand

Joined: Oct 05, 2006
Posts: 36
The spec saying different things..! So what is correct? Somebody please clarify. I already have a lot of things to be confused about.
Sreeraj G Harilal
Ranch Hand

Joined: Apr 19, 2006
Posts: 310
I already have a lot of things to be confused about.

its really funny


SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
Arvind Giri
Ranch Hand

Joined: Jun 26, 2005
Posts: 91
Hey! I got the answer, its very ridiculous.

I developed a simple tag and didn't specify the body-content.

myTags.tld



TestTagHandler.java



test.jsp



and I am getting following exception




Does that mean that default value of body-content is JSP( Irrespective of type of tag(be it simple or classic)), But simple tag don't support JSP as body-content?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: default value of tag
 
Similar Threads
body-content values
is value in DD tags case sensitive?
is body-content mandatory in jsp 2.0
Simple Tag Handler Default body content
body-content