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 18:06:44 GMT
What does

 '<c:out value="${rs.question_type}" />'

output?  (The outer quotes are there to make spaces more noticeable.)

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

On Fri, 2 Aug 2002, Dave Anand wrote:

> Thanks for Responding; Well I did something like this, But the test always
> gave me false
> 
> <c:forEach var="rs" items="${question.rows}">
>     <c:if test="${rs.question_type== '1'}">
>        <c:set var="controlType" value="radio" />
>     </c:if>
> 
>      <c:if test="${rs.question_type=='2'}">
>         <c:set var="controlType" value="checkbox" />
>     </c:if>
>   </c:forEach>
> 
> ----- Original Message -----
> From: "Shawn Bayern" <bayern@essentially.net>
> To: "Dave Anand" <anand@columbus.rr.com>
> Cc: "Tag Libraries Users List" <taglibs-user@jakarta.apache.org>
> Sent: Friday, August 02, 2002 1:46 PM
> Subject: 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:
> <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:taglibs-user-help@jakarta.apache.org>
> >
> 


--
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