Tag Archives: JSP tag forwarding forword error

[Solved] JSP tag forwarding forword error: org.apache.jasper.JasperException

Error reporting type

org.apache.jasper.JasperException: /jsptag1.jsp (行.: [11], 列: [0]) Expect the "jsp:param" standard operation using the "name" and "value" attributes

Problem Description:

29-Aug-2021 18:08:39.881 严重 [http-nio-8080-exec-5] org.apache.catalina.core.StandardWrapperValve.invoke 在路径为/jsp的上下文中,Servlet[jsp]的Servlet.service()引发了具有根本原因的异常/jsptag1.jsp (行.: [11], 列: [0]) 使用“name”和“value”属性期望“jsp:param”标准操作
	org.apache.jasper.JasperException: /jsptag1.jsp (行.: [11], 列: [0]) 使用“name”和“value”属性期望“jsp:param”标准操作
		at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41)
		at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:292)
		at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:98)
		at org.apache.jasper.compiler.Parser.parseParam(Parser.java:843)
		at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1696)
		at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1020)
		at org.apache.jasper.compiler.Parser.parseForward(Parser.java:884)
		at org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1136)
		at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1474)
		at org.apache.jasper.compiler.Parser.parse(Parser.java:144)
		at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
		at org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
		at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:206)
		at org.apache.jasper.compiler.Compiler.compile(Compiler.java:391)
		at org.apache.jasper.compiler.Compiler.compile(Compiler.java:367)
		at org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
		at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:605)
		at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399)
		at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
		at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327)
		at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
		at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
		at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
		at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
		at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
		at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
		at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
		at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
		at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
		at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
		at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
		at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
		at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
		at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1726)
		at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
		at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
		at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
		at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
		at java.lang.Thread.run(Thread.java:748)

Solution:

Dynamically introduce or forward tags with spaces or comments in the middle

In addition to writing < jsp:param name="" value="" /> The sub tag will not report an error, and any other character will report an error.

Error:
<jsp:forward page="/jsptag2.jsp">
    <jsp:param name="username" value="root"></jsp:param>
    <jsp:param name="password" value="admin"></jsp:param>
</jsp:forward>



Error-Free:
<jsp:forward page="/jsptag2.jsp">
    <jsp:param name="username" value="root"></jsp:param>
    <jsp:param name="password" value="admin"></jsp:param>
</jsp:forward>