Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

SimpleTag default body-content value ?

 
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:
 
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?

 
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'
 
We don't have time to be charming! Quick, read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic