作业进击三国10连抽图:tomcat 中找不到 javax.servlet.jsp.tagext

来源:百度文库 编辑:中科新闻网 时间:2024/04/28 19:52:34
package tagclass;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.JspTagException;
import java.text.SimpleDateFormat;
public class timeTag extends TagSupport {
public int doEndTag() throws JspException {
SimpleDateFormat sdf;
sdf = new SimpleDateFormat("HH:mm:ss");
String time = sdf.format( new java.util.Date());
try{
pageContext.getout().print(time);
}
catch(Exception e) {
throw new JspException(e.toString());
}
return EVAL_PAGE;
}
}
找不到包, 没有 servlet.jar包,用servlet-api.jar好像不行。

要放在%TOMCAT_HOME%/common/lib下这里是公共包的地方.