wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Is body-content= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Is body-content="JSP" useless now ?" Watch "Is body-content="JSP" useless now ?" New topic
Author

Is body-content="JSP" useless now ?

Vikrant Pandit
Ranch Hand

Joined: Mar 27, 2006
Posts: 245
Given that body-content can have the following four values

JSP
scriptless
tagdependent
empty

but the body of the tag files and simple tags cannot have scripting elements , so am I right in saying the following statements ?

<body-content>JSP</body-content> is redundant .

<body-content>JSP</body-content> is equivalent to
<body-content>scriptless</body-content> for all practical purposes

Also are the classic tag still allowed to use <body-content>JSP</body-content> ? I guess it is allowed for backward compatibilty

Thanks


Vikrant Pandit
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

If you specify a body content that is not allowed ( JSP ) you will get an error. I dont know about classic tags but this is true for simple tags.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Vikrant Pandit
Ranch Hand

Joined: Mar 27, 2006
Posts: 245
I tried to run some examples in Tomcat 5.5 / Netbeans ide

Here are my findings

1) Classic Tags are allowed to have all the four values of body-content
i.e. scriptless,JSP,empty and tagdependent

2) Having scripting elements in the body of a classic tag is NOT an error
if the body-content is set to scriptless

Thus it seems tag files and Simple Tags , which were introduced in JSP 2.0 , are not allowed to have scripting elements in their body . Thus only possible values for them are scriptless,empty and tagdependent

However, classic tags can have scripting elements and also all the four values for the body-content.

Surprisingly HFSJ does not talk about this difference.

Ranchers please share your views !!!
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
I have a suspicion that the thinking behind this is that users should be moving away from scriptlets towards technologies such as JSTL and EL so they disabled the JSP option for within simple tags and tag files.

http://www.examulator.com/moodle/course/view.php?id=5


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Shivani Chandna
Ranch Hand

Joined: Sep 18, 2004
Posts: 380
Vivek,

As you have rightly mentioned, classic tags can take JSP in body content as well.
In HFSJ they have not explicitly mentioned the difference. But this point has been discussed often in this forum.

Regards,
Shivani


/** Code speaks louder than words */
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is body-content="JSP" useless now ?
 
Similar Threads
Doubt on Qno-:5 Pno-:487(HFS&JSP)
body-content as JSP
Default values for body-content element
Doubt in HeadFirst question
JspFragment