我正在使用struts1.1。当我重定向到一个jsp文件时,我得到以下异常。我无法弄清楚错误的位置。
org.apache.jasper.JasperException: /jsp/jobcard/JobCardAdd.jsp(908,3) Expecting "jsp:param" standard action with "name" and "value" attributes
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:86)
at org.apache.jasper.compiler.Parser.parseParam(Parser.java:861)
at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1813)
at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
at org.apache.jasper.compiler.Parser.parseInclude(Parser.java:897)
at org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1220)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1572)
at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1802)
at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1376)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1573)
at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1802)
at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1376)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1573)
at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
- ERROR Servlet.service() for servlet action threw exception
答案 0 :(得分:23)
我通过将以下include标记更改为单个标记版本来修复此错误。
在:
<jsp:include page="..."></jsp:include>
我改变了这个,
<jsp:include page="..."/>
现在我没有得到这种类型的例外。
答案 1 :(得分:2)
在我的情况下,我没有正确结束标记。如下。
<jsp:include page="..."
&GT;
我已将其更改为
<jsp:include page="..."/>
这解决了我的问题。
答案 2 :(得分:1)
如果您未在同一行中关闭代码,则需要在<jsp:param name="someName" value="someValue" />
<jsp:include></jsp:include>
答案 3 :(得分:1)
我不得不更改它:
<jsp:forward page='redirect.jsp'>
</jsp:forward>
对此:
<jsp:forward page='redirect.jsp'/>
答案 4 :(得分:0)
从weblogic迁移到tomcat服务器后,我的项目中也发生了此错误
实际上,如果您有<jsp:param name="xxx" value="yyy" />
我的Tomcat服务器也不喜欢我有注释,所以我只删除了它们,然后它起作用了
<jsp:include page="/jsp/myJsp.jsp" flush="true">
<jsp:param name="formName" value="someValueForm" /> <!-- it indicated the form to use -->
<jsp:param name="someFunction" value="someFunction" /> <!-- a comment here --> </jsp:include>
答案 5 :(得分:0)
当我在标签内发表评论时,我遇到了同样的错误。当我从该区块中删除评论时,它就起作用了。
ComponentC