tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21711] New: - Error when compiling a JSP that uses a TLD 1.1
Date Fri, 18 Jul 2003 14:37:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21711>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21711

Error when compiling a JSP that uses a TLD 1.1

           Summary: Error when compiling a JSP that uses a TLD 1.1
           Product: Tomcat 5
           Version: 5.0.4
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper2
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: egiraudy@instranet.com


When compiling a jsp that uses a 1.1 TLD, with tag that have an attribute called 
"id", it generates the following error:

java.lang.ClassCastException
        at javax.servlet.jsp.tagext.TagData.getAttributeString(TagData.java:176)
        at javax.servlet.jsp.tagext.TagData.getId(TagData.java:129)
        at javax.servlet.jsp.tagext.TagInfo.getVariableInfo(TagInfo.java:282)
        at org.apache.jasper.compiler.Node$CustomTag.setTagData(Node.java:1475)
        at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.
java:788)
        at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1444)
        at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2142)
        at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2184)
        at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2190)
        at org.apache.jasper.compiler.Node$Root.accept(Node.java:471)
        at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2142)
        at org.apache.jasper.compiler.Validator.validate(Validator.java:1499)
        at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:264)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:444)
        at org.apache.jasper.JspCompilationContext.
compile(JspCompilationContext.java:603)
        at org.apache.jasper.servlet.JspServletWrapper.
service(JspServletWrapper.java:300)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
293)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at org.apache.catalina.core.ApplicationFilterChain.
internalDoFilter(ApplicationFilterChain.java:286)
        at org.apache.catalina.core.ApplicationFilterChain.
doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.
invoke(StandardWrapperValve.java:256)
        at org.apache.catalina.core.StandardValveContext.
invokeNext(StandardValveContext.java:151)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
java:562)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
        at org.apache.catalina.core.StandardContextValve.
invoke(StandardContextValve.java:205)
        at org.apache.catalina.core.StandardValveContext.
invokeNext(StandardValveContext.java:151)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
java:562)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.
java:177)
        at org.apache.catalina.core.StandardValveContext.
invokeNext(StandardValveContext.java:151)
        at org.apache.catalina.valves.ErrorDispatcherValve.
invoke(ErrorDispatcherValve.java:171)
        at org.apache.catalina.core.StandardValveContext.
invokeNext(StandardValveContext.java:149)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.
java:172)
        at org.apache.catalina.core.StandardValveContext.
invokeNext(StandardValveContext.java:149)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
java:562)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
        at org.apache.catalina.core.StandardEngineValve.
invoke(StandardEngineValve.java:156)
        at org.apache.catalina.core.StandardValveContext.
invokeNext(StandardValveContext.java:151)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
java:562)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:
203)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.
java:637)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.
processConnection(Http11Protocol.java:488)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.
java:568)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.
run(ThreadPool.java:631)
        at java.lang.Thread.run(Thread.java:534)


in the tld the tag is declared as:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC
  "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
  "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
   <tlibversion>1.0</tlibversion>
   <jspversion>1.1</jspversion>
   <shortname></shortname>
   <tag>
      <name>myTag</name>
      <tagclass>com.foo.myTag</tagclass>
      <bodycontent>empty</bodycontent>
      <info>
      </info>
      <attribute>
         <name>bean</name>
         <required>false</required>
         <rtexprvalue>true</rtexprvalue>
      </attribute>
      <attribute>
         <name>id</name>
         <required>false</required>
         <rtexprvalue>true</rtexprvalue>
      </attribute>
   <tag>
</taglib>

it is then used like this:

<%@ page language="java" contentType="text/html; charset=ISO-8859-15" %>
<%@ taglib uri="mytld.tld" prefix="myTld"	%>
...
<jsp:useBean id="myBean" class="com.foo.myBean"/>
<myTld:myTag beanName="myBean" id="<%=String.valueOf(nSomeId)%>"/>
...


this is working fine with tc 4.0.6 and 4.1.26
I'm running on Win2000 with jdk 1.4.2.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message