struts 1.0 logic tag choice - if/else logic
20,160
<c:choose>
<c:when test="${the number}">
Both are equal.
</c:when>
<c:otherwise>
Both are not equal.
</c:otherwise>
</c:choose>
this is jstl tag
you need to use
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
Comments
-
bouncingHippo about 4 years
What I have is a dropdown list. When the user selects a certain option, where each option represents a specific String on the Java server side.
Right now, the Java server side able to check which option is selected, and the number to correspond. At the moment, I am able to output the value in Java backend, not on the JSP page.
Is there an if/else tag for Struts 1.0?
I am not sure which logic tag is the best to pass a Java value for frontend processing:
JSP page
if(value = 666) this textbox is readonly else this textbox row is active
My research so far:
Looking at
logic:equal
, it seems to pass a value on the JSP page using taglibs like below. This doesn't work for me, because I want to pass the value FROM a Java class on the server side.<logic:equal name="name" property="name" value="<%= theNumber %>" >
-
bouncingHippo about 11 yearsis
${the number}
jQuery? would you have a javascript version? -
PSR about 11 yearsno it is action variable.we are using in struts2 like this.this might work in struts1.0 as well
-
Dave Newton about 11 years@bouncingHippo jQuery?! It's standard JSP EL notation.