2016-08-19 2 views
1

Struts2를 사용하여 URL에서 매개 변수를 가져 오려고하지만 작동하지 않습니다. EL을 사용하여 얻을 수는 있지만 Struts2에서는 사용할 수 없습니다.Strust2 OGNL을 사용하여 JSP에서 URL 매개 변수를 가져 오는 방법

showReport은 URL에 전달됩니다.

JSTL과 EL을 사용하여이

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

가 나는 동 잘못 누구인지 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 작동?

답변

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>