• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SimpleTag default body-content value ?

 
Raju Sri
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have doubt regarding the default body-content for SimpleTag . As per my understanding I am thinking that "scriptless" is the default value for body-content for SimpleTag and "JSP" is the default value for ClassicTag. Am I right ?

I am running one SimpleTag example without specifying any body-content. I am getting the below error message on Tomcat 5.0.27 .
#######################################################
org.apache.jasper.JasperException: /simple/test1.jsp(3,0) The TLD for the class com.raju.simpletag.HelloWorldSimpleTag specifies an invalid body-content (JSP) for a SimpleTag.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:641)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Validator.validate(Validator.java:1475)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:214)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
#####################################################
for the above tag I defined tag in .tld file like below
<tag>
<name>basic</name>
<tag-class>com.raju.simpletag.HelloWorldSimpleTag</tag-class>
</tag>

So does that mean default body-content type for SimpleTag is JSP ??

:roll:
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings!

I don't think the compiler checks for the type of Tag you declared.
For as long as you didn't specify a <body-content> element then it will
default to "JSP" value.

Correct me if I'm wrong ok?

 
Alberto Justo
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by raju srinivasa:
Hi all,

I have doubt regarding the default body-content for SimpleTag . As per my understanding I am thinking that "scriptless" is the default value for body-content for SimpleTag and "JSP" is the default value for ClassicTag. Am I right ?

So does that mean default body-content type for SimpleTag is JSP ??



Actually, i think that the default body-content type in a Tag Library Descriptor is 'JSP', the container does not check if is SimpleTag or Tag

If you use tag files, the directive <%@ tag %> has the attribute body-content, and in this case the default it is 'scriptless'
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic