2017-12-08 5 views
0

次のコードスニペットを見て、それを実行しようとすると以下のエラーが表示されるので、何が問題なのかを教えてください。ダイナミックURLのjspページを含めるときにJasper例外が発生する

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 

ここで私は、私もあまりにもやり方を以下にJavaオブジェクトを宣言しようとした

<% 
    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> 

を実行しようとしているコードです。しかし、運がない。

<%! 
    String contextRoot = request.getContextPath(); 
    String stdInfoViewURL = contextRoot.concat("jsp/student/ViewStudentDetails.jsp"): 
%> 
+0

から、あなたはまだ '' の内側に '' を追加した後、エラーを取得していますか?あなたのコードを貼り付けたときに私はそのエラーを受け取らなかったので、 – NAK

+0

はい。私はエラーが発生しています。私も内部に含めてみた。 –

+0

は、CorpUserAddNew.jsp – NAK

答えて

2

省略contextRootあなたstdInfoViewURLとちょうどん

String stdInfoViewURL = "/jsp/student/ViewStudentDetails.jsp":

関連する問題