• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is body-content="JSP" useless now ?

 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!!
 
arch rival
Posts: 2813
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic