JSP -期望具有“name”和“value”属性的“jsp:param”标准操作

j9per5c4  于 2023-03-27  发布在  其他
关注(0)|答案(6)|浏览(211)

我使用的是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
4nkexdtk

4nkexdtk1#

我通过将以下include标记更改为单个标记版本来修复此错误。
之前:

<jsp:include page="..."></jsp:include>

我变成这样,

<jsp:include page="..."/>

现在我没有得到这种类型的例外。

ffscu2ro

ffscu2ro2#

在我的情况下,我没有结束标签正确.像下面.
<jsp:include page="..."
我已经改成

<jsp:include page="..."/>

这为我解决了这个问题。

j2datikz

j2datikz3#

如果不在同一行中结束标记,则需要在<jsp:include></jsp:include>中包含<jsp:param name="someName" value="someValue" />

ebdffaop

ebdffaop4#

在我的项目从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>
qgzx9mmu

qgzx9mmu5#

当我在<jsp:include>标签中给出注解时,我得到了同样的错误。当我从那个块中删除注解时,它工作了。

<!-- 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>
bvuwiixz

bvuwiixz6#

我不得不改变这一点:

<jsp:forward page='redirect.jsp'>
</jsp:forward>

改为:

<jsp:forward page='redirect.jsp'/>

相关问题