请看下面的代码片段,让我知道有什么问题,因为我得到了下面的错误,当我试图运行它。
org.apache.jasper.JasperException: The jsp:param action must not be used outside the jsp:include, jsp:forward, or jsp:params elements
org.apache.jasper.JasperException: Expecting "jsp:param" standard action with "name" and "value" attributes下面是我要执行的代码
<%
String contextRoot = request.getContextPath();
String stdInfoViewURL = contextRoot.concat("jsp/student/ViewStudentDetails.jsp"):
%>
<html><body>
<jsp:include page="<%=stdInfoViewURL%>" flush="true">
<jsp:param name="studentId" value="ABC123" />
<jsp:param name="studentName" value="MARK TAYLOR" />
</jsp:include>
</body></html>我甚至尝试以以下方式声明java对象。但没有运气。
<%!
String contextRoot = request.getContextPath();
String stdInfoViewURL = contextRoot.concat("jsp/student/ViewStudentDetails.jsp"):
%>发布于 2017-12-08 08:48:56
将contextRoot从您的stdInfoViewURL中省略,只需执行
String stdInfoViewURL = "/jsp/student/ViewStudentDetails.jsp":
https://stackoverflow.com/questions/47708676
复制相似问题