Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tag bodies and JspFragment  RSS feed

 
Gordon Brown
Ranch Hand
Posts: 58
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'd be grateful if someone could clear up this confusion for me:
Possible values for the tag are:
empty, scriptless, tag-dependent, and JSP.

SimpleTag's setJspBody() method takes a JspFragment.
JspFragment can't contain any scripting elements.

Presumably that means that you can never declare the of a simple tag to be "JSP", and therefore only classic tags can contain scripting elements in the body?

Or am I missing something?

thanks,

Gordy
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple tags can be empty or scriptless. Scripting elements (in other words, scriptlets) cannot be used in the body of simple tags.

In other words, either write your tags using JSP 1.x features: classic tags and scriptlets, or write them using JSP 2.0 mechanisms: simple tags, tag files and JSTL/EL.

Don't mix and match.
 
Gordon Brown
Ranch Hand
Posts: 58
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gotcha, thanks Bear.

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