2016-08-19 2 views
1

Struts2を使用してURLからパラメータを取得しようとしていますが、機能しません。私はELを使って得ることができますが、Struts2では使用できません。Strust2 OGNLを使用してJSPでURLパラメータを取得する方法

showReportがURLに渡されます。 JSTLとELを使用して

は、それは私がドン間違っているのかわからS2 OGNLを使ってそれを実行する必要はありません

<c:choose> 
    <c:when test="${param.showReport eq true}"> 
     <a href="#x" style="width:155px" title="This function will provide you a 30 day download of all your eSign transactions." onclick="document.getElementById('viewIntegrationReport').submit()"><span>Export E-Sign Information</span></a> 
    </c:when> 
    <c:when test="${param.showReport eq false}"></c:when> 
     <c:when test="${empty param.showReport}"></c:when> 
</c:choose> 

S2道

<s:if test="%{param.showReport=='true'}"> 
     <a href="#x" style="width:155px" title="This function will provide you a 30 day download of all your eSign transactions." onclick="document.getElementById('viewIntegrationReport').submit()"><span>Export E-Sign Information</span></a> 
</s:if> 

に動作しますか?

答えて

1

私はそれを理解しました。

<s:if test="%{#parameters.showReport}"> 
    <a href="#x" style="width:155px" title="This function will provide you a 30 day download of all your eSign transactions." onclick="document.getElementById('viewIntegrationReport').submit()"><span>Export E-Sign Information</span></a> 
</s:if> 
<s:else> 
    <h4>Hello World</h4> 
</s:else> 
関連する問題