*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes SimpleTag default  body-content value ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "SimpleTag default  body-content value ?" Watch "SimpleTag default  body-content value ?" New topic
Author

SimpleTag default body-content value ?

Raju Sri
Ranch Hand

Joined: Mar 10, 2004
Posts: 108
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:


SCJP 1.4<br />SCWCD 1.4<br />SCBCD 1.3<br />SCDJWS 1.4
Paul Michael
Ranch Hand

Joined: Jul 02, 2001
Posts: 697
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?



SCJP 1.2 (89%), SCWCD 1.3 (94%), IBM 486 (90%), SCJA Beta (96%), SCEA (91% / 77%), SCEA 5 P1 (77%), SCBCD 5 (85%)
Alberto Justo
Greenhorn

Joined: Aug 20, 2004
Posts: 6
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'
 
wood burning stoves
 
subject: SimpleTag default body-content value ?
 
Similar Threads
problem with the name attribute of form tag
jstl - fmt Tag problem
default value of tag
getting variable value
how to use struts specific html taglib?