Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

taglib don't work!An error occurred at line: -1 in the jsp file: null?!  RSS feed

 
Yashnoo lyo
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone:
I write a simple jsp file with taglib to test whether it can work property.But it says"org.apache.jasper.JasperException: Unable to compile class for JSP
"When I compile it with Tomcat4.1.The specific error information in the browser is ://////////////////////////error info///////////////////////////////////
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] E:\Tomcat4\work\Standalone\localhost\_\testtag_jsp.java:82: can't resolve the charactor [javac] charactorclass Tagtest
[javac] locationclass in org.apache.jsp.testtag_jsp
[javac] Tagtest _jspx_th_lyotag_tag_0 = (Tagtest) _jspx_tagPool_lyotag_tag.get(Tagtest.class);
[javac] ^
[javac] E:\Tomcat4\work\Standalone\localhost\_\testtag_jsp.java:82: Can't resolve the character [javac] charactorclass Tagtest
[javac] locationclass in org.apache.jsp.testtag_jsp
[javac] Tagtest _jspx_th_lyotag_tag_0 = (Tagtest) _jspx_tagPool_lyotag_tag.get(Tagtest.class);
[javac] ^
[javac] E:\Tomcat4\work\Standalone\localhost\_\testtag_jsp.java:82: can't resolve the charactor [javac] characterclass Tagtest
[javac] locationclass in org.apache.jsp.testtag_jsp
[javac] Tagtest _jspx_th_lyotag_tag_0 = (Tagtest) _jspx_tagPool_lyotag_tag.get(Tagtest.class);
[javac] ^
[javac] three error
///////////////////////////////////////////////////////////////////////////////
But I have include the package in my java file:
////////////////////////Tagtest.java///////////////////////////
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.Writer;
public class Tagtest extends TagSupport{
public int doStartTag()throws JspException{
try{
JspWriter out=pageContext.getOut();
out.println("hello Tag!");
}catch(Exception e){
}
return SKIP_BODY;
}
}
//////////////////////////////Tagtest.tld//////////////////////////
.... .......... ........ ........ ......... ..........
<tag>
<name>tag</name>
<tag-class>Tagtest</tag-class>
<body-content>empty</body-content>
<description>
Perform a server side action; Log the message.
</description>
</tag>
......... ......... ......... ....... ......... ........ .........
//////////////////////////testtag.jsp////////////////////////
........ ...... ....... ....... ........ ... .....
<%@ taglib uri="/taglib/Tagtest.tld" prefix="lyotag"%>
<h6>Hi Lyo</h6>
<lyotag:tag/>
....... ........ .......... ........ ...... ......
Why can't compile my jsp file?Where is it wrong?Please help me.Thank you!


:roll: :roll:
 
Yashnoo lyo
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should anyone can help me? :roll:
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!