Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

tag library compile

Zollinhofer, Matt

2004-05-18


I get the following error when compiling HelloTag.java (below as well). It has an associated taglib.tld in the lib directory.

I thought I found a solution after googling the error that suggested I put servlet.jar in the java classpath. So, I put it in the extentions directory. I could compile HelloTag.java, but it broke other parts of tomcat (the examples that come with the standard installation of Tomcat stopped working).

-----------Error-------

HelloTag.java:3: package javax.servlet.jsp does not exist
import javax.servlet.jsp.JspException;

HelloTag.java:4: package javax.servlet.jsp does not exist
import javax.servlet.jsp.JspTagException;

HelloTag.java:7: cannot resolve symbol
symbol : class TagSupport
location: class com.onjava.HelloTag
public class HelloTag extends TagSupport


-----------Code----------

HelloTag.java code:
package com.onjava;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.TagSupport;

public class HelloTag extends TagSupport
{
public void HelloTag() {

}
public int doEndTag() throws JspException {

try {

 pageContext.getOut().print("Hello");
}
catch (Exception e) {

 throw new JspTagException(e.getMessage());
}
return SKIP_BODY;
}

public void release() {

super.release();
}
}

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.