2016-08-19 2 views
1

Ich versuche Parameter von der URL mit Struts2 zu bekommen, aber es funktioniert nicht. Ich kann es mit EL aber nicht mit den Struts2 bekommen.Wie bekomme ich URL-Parameter in JSP mit Strust2 OGNL

showReport wird in der URL übergeben.

Mit JSTL und EL funktioniert es

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

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

Ich brauche es zu tun mit S2 OGNL nicht sicher, was ich bin dong falsch?

Antwort

1

Ich habe es herausgefunden.

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