0

i am iterating a Vo in Jsp using struts tag in which i get a integer value

<struts_logic:iterate id="usersVO" indexId="index" name="data" type="utils.vo.UsersVO">

<td class="tabletext"><struts_bean:write name="usersVO" property="userType"/></td>

here userType is a int value. how can i get this value in

<%
  int x = **here**
%>

so i can process it for display.

Or is there any other way through which i can display String value depend upon coming int value?

2 Answers 2

1

Sounds like you should you <c:choose>. For example:

<c:choose>
    <c:when test="${usersVO.userType==1}">
        <p>User type is 1</p>
    </c:when>
    <c:when test="${usersVO.userType==2}">
        <p>etc</p>
    </c:when>
   <c:otherwise>
       <p>User type is unknown</p>
   </c:otherwise>
</c:choose>
0
0

i used struts logic:equal tag to do this and its works fine for me

<struts_logic:equal name="usersVO" property="userType" value="0">
   <struts_bean:message key ="usermanagement.NotAuthorization"/>                    
</struts_logic:equal>
<struts_logic:equal name="usersVO" property="userType" value="1">
   <struts_html:link page="/anzeige.do" paramId="authorization" paramName="usersVO" paramProperty="userName" style="text-decoration: none;">
      <struts_bean:message key ="usermanagement.Authorization" />
   </struts_html:link>
</struts_logic:equal>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.