You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Shawn Bayern <ba...@essentially.net> on 2002/08/02 19:46:15 UTC

Re: is there a better way to do this without JSP Script var

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>