tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Bayern <bay...@essentially.net>
Subject Re: is there a better way to do this without JSP Script var
Date Fri, 02 Aug 2002 17:46:15 GMT
On Fri, 2 Aug 2002, Dave Anand wrote:

> Is there a better way to do this without JSP Script var
>     
> <c:forEach var="rs" items="${question.rows}">
>   <c:set var="qType" value="${rs.QUESTION_TYPE}" />
>   <% String sqType = pageContext.getAttribute("qType").toString(); %><br>
> 
>   <%if (sqType.equals("1")) { %>
>      <c:set var="controlType" value="radio" />
>   <%} else if (sqType.equals("2")) {%>
>      <c:set var="controlType" value="checkbox" />
>   <%} else if (sqType.equals("2")) {%>
>      <c:set var="controlType" value="select" />
>      <c:out value=" <select> "/>
>   <%} %>
> 
> </c:forEach> 

The following should work:

 <c:forEach var="Rs" items="${questions.rows}">
   <c:set var="qType" value="${rs.question_type}" />
   <c:choose>
     <c:when test="${qType == 1}">
       ...

and so forth.

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message