Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is body-content="JSP" useless now ?

 
Vikrant Pandit
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vikrant Pandit
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic