jsp的运行问题。

love722915 2001-07-23 09:43:29
我用 jsp + tomact 运行环境
test.jsp 调用同一目录下的 test/Operate.class 文件。

错误如下: 请指点。
A Servlet Exception Has Occurred
org.apache.jasper.compiler.ParseException: C:\jakarta-tomcat-4.0-b5\webapps\ROOT\jsp\test2.jsp(2,4) Invalid directive
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:214)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1126)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1091)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1087)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:220)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:207)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:523)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:175)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:187)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
at java.lang.Thread.run(Thread.java:484)

...全文
45 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
luodi 2001-07-28
<%@ language="java" %>
==>
<%@ page language="java" %>
回复
love722915 2001-07-23
高手帮我呀。。。
回复
love722915 2001-07-23
------------------test2.jsp-----------------------------------
<html>
<body>
<%@ language="java" %>
<jsp:useBean id="workM" scope="page" class="test.Operate"/>
<%
int addNumber=workM.Add(3,5);
int subNumber=workM.Sub(10,4);
out.print(addNumber);
out.print(subNumber);
%>
</body>
</html>

------------------------Operate.java----------------------------
package test;

public class Operate
{
public int Add(int number1,int number2)
{
return number1+number2;
}
public int Sub(int number1,int number2)
{
return number1-number2;
}
public static void main(String[] args)
{
}
}
回复
luodi 2001-07-23
提示的错误是 test.jsp 中有非法的 directive ,也就是页面的 <%@ 之类的地方有非法的指令,再检查一下 test.jsp 或贴出来看一下。
回复
love722915 2001-07-23
各位高手:
这到底是何问题呀。。
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2001-07-23 09:43
社区公告
暂无公告