• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tag Files: Body content does not accept Jsp script elements

 
Nicky Formosa
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a problem which i can't seem to solve. I'm using Jsp2.1 tag Files for my presentation. Having the Jsp with multiple .tag files.

Some of these Tag files may contain a body, and the body may also be formed of jsp elements such as:

<mytag: tagname >
<% int s = 5; %>
</mytag: tagname>

This is not particularly working giving me an error of having scripts where there shouldn't be!

Is there any solution to this? Any help would be greatly appreciated!

Regards
NF
 
Jan van Mansum
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know about JSP 2.1 but in version 2.0 you could not use scriptlets in a tag file. You would have to use standard actions, JSTL or your own action elements.
 
Jan van Mansum
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I may have understood your question incorrectly. Maybe you meant that "tagname" is the tag implemented in your tag file. In that case the body of "tagname" can still not have any scripting elements because a tag file is compiled into a tag handler that implements javax.servlet.jsp.tagext.SimpleTag and the body-content of SimpleTags may not be of type JSP, at most it may be "scriptless" which means that EL is allowed, but no scriptlets.

At any rate, this is how it worked in JSP 2.0. It might have changed in version 2.1 but I couldn't find any reference to that effect.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic