jsp - What is the equivalent Struts 2 tag for the following Struts 1 tag? -
i'm migrating struts 1 struts 2. don't know equivalent struts2 tag following struts1 tag
<logic:equal value="1234" name="custdetail" property="ackmsg"> <% string str = valid %> </logic:equal> the custdetail attribute set in request should have value 1234. if script variable str assigned 'valid' value. equivalent jsp code using struts2 tags
struts 1:
<logic:equal value="1234" name="custdetail" property="ackmsg"> <% string str = "valid" %> </logic:equal> struts 2 :
<s:if test="custdetail.ackmsg == '1234'"> <% string str = "valid" %> </s:if> struts 2 refactored remove scriptlet:
<s:if test="custdetail.ackmsg == '1234'"> <s:set var="str" value="%{'valid'}"/> </s:if> , , str value later with:
<s:property value="%{#str}" />
Comments
Post a Comment