当前位置: 技术问答>java相关
在编译使用扩展标签的java文件时,得到package javax.servlet.jsp does not exist,package javax.servlet.jsp does not exist的错误
来源: 互联网 发布时间:2015-08-10
本文导语: dailyPick.java文件中已经导入了这两个包: import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; ... public class dailyPick extends TagSupport { ... } 编译时,出错: myTagLibdailyPick.java:3: package javax.servlet.jsp does ...
dailyPick.java文件中已经导入了这两个包:
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
...
public class dailyPick extends TagSupport {
...
}
编译时,出错:
myTagLibdailyPick.java:3: package javax.servlet.jsp does not exist
import javax.servlet.jsp.*;
^
myTagLibdailyPick.java:4: package javax.servlet.jsp.tagext does not exist
import javax.servlet.jsp.tagext.*;
^
myTagLibdailyPick.java:11: cannot resolve symbol
symbol : class TagSupport
location: class myTagLib.dailyPick
public class dailyPick extends TagSupport {
^
myTagLibdailyPick.java:22: cannot resolve symbol
symbol : class JspTagException
location: class myTagLib.dailyPick
public int doStartTag() throws JspTagException {
^
myTagLibdailyPick.java:89: cannot resolve symbol
symbol : class JspWriter
location: class myTagLib.dailyPick
JspWriter out = pageContext.getOut();
^
myTagLibdailyPick.java:89: cannot resolve symbol
symbol : variable pageContext
location: class myTagLib.dailyPick
JspWriter out = pageContext.getOut();
^
myTagLibdailyPick.java:96: cannot resolve symbol
symbol : variable SKIP_BODY
location: class myTagLib.dailyPick
return (SKIP_BODY);
^
7 errors
环境变量中已经设定了Classpath:
..;.;%JAVA_HOME%libtools.jar;
运行环境:winxp
谢谢
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
...
public class dailyPick extends TagSupport {
...
}
编译时,出错:
myTagLibdailyPick.java:3: package javax.servlet.jsp does not exist
import javax.servlet.jsp.*;
^
myTagLibdailyPick.java:4: package javax.servlet.jsp.tagext does not exist
import javax.servlet.jsp.tagext.*;
^
myTagLibdailyPick.java:11: cannot resolve symbol
symbol : class TagSupport
location: class myTagLib.dailyPick
public class dailyPick extends TagSupport {
^
myTagLibdailyPick.java:22: cannot resolve symbol
symbol : class JspTagException
location: class myTagLib.dailyPick
public int doStartTag() throws JspTagException {
^
myTagLibdailyPick.java:89: cannot resolve symbol
symbol : class JspWriter
location: class myTagLib.dailyPick
JspWriter out = pageContext.getOut();
^
myTagLibdailyPick.java:89: cannot resolve symbol
symbol : variable pageContext
location: class myTagLib.dailyPick
JspWriter out = pageContext.getOut();
^
myTagLibdailyPick.java:96: cannot resolve symbol
symbol : variable SKIP_BODY
location: class myTagLib.dailyPick
return (SKIP_BODY);
^
7 errors
环境变量中已经设定了Classpath:
..;.;%JAVA_HOME%libtools.jar;
运行环境:winxp
谢谢
|
你在环境变量中的Classpath加上servlet.jar这个包,如果是tomcat这个包在tomcatlib下。
|
你是tomcat4的话,在tomcatcommonlib下面。