This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it legal to embed scriptlets inside custom tag body  RSS feed

 
Mike lothar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it legal to embed scriptlets inside Custom tag body, i mean to say setting <body-content> tag in taglib to JSP.

Thank you
Mike
 
Gabriel Forro
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Yes it is legal. The rule is:
You can set <body-content> to JSP only for the classic custom tags (which implement the Tag interface) and then You can use scriptlet in the body of the tag.

!But You can not set <body-content> to JSP for custom tags which implement the SimpleTag interface and for tag files. For these tags, the legal options are: empty, tagdependent, scriptless.
 
Abhishek Mahanty
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike lothar:
Is it legal to embed scriptlets inside Custom tag body, i mean to say setting <body-content> tag in taglib to JSP.

Thank you
Mike


Hi,
Check this out

http://www.coderanch.com/t/168570/java-Web-Component-SCWCD/certification/JSP-valid-value-body-content

Abhi.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!