JSP - Expecting "jsp:param" standard action with "name" and "value" attributes
I am using struts1.1. When i redirect to one jsp file, i got the following exception. I cannot figure out where the error is.
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
I fixed this error by changing the following include tag as single tag version.
Before:
<jsp:include page="..."></jsp:include>
I changed like this,
<jsp:include page="..."/>
Now i did not get this type of exception.
In my case, I did not end tag properly. like below.
<jsp:include page="..."
>
I have changed it to
<jsp:include page="..."/>
This fix the issue for me.
If you don't close the tag in the same line, you need to have a <jsp:param name="someName" value="someValue" />
within <jsp:include></jsp:include>
This error also happened in my project after a migration from weblogic to tomcat server
actually you can close the tag in a different line if you have <jsp:param name="xxx" value="yyy" />
also what my Tomcat Server didn't like is that i have comments so i just deleted them and then it worked
<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>
I had to change this:
<jsp:forward page='redirect.jsp'>
</jsp:forward>
to this:
<jsp:forward page='redirect.jsp'/>
I got the same error when I gave comments inside <jsp:include>
tag. When I removed the comments from that block, it worked.
<!-- comment supported here -->
<jsp:include page="/jsp/include/productAttributePopUp.jsp" >
<!-- comment not supported here -->
<jsp:param name="showProdClassification" value="true"/> <!-- comment not supported here -->
</jsp:include>
精彩评论