tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charl Gerber" <xp139...@tiscali.nl>
Subject JSTL question: how to use variables in <c:if> and <c:set>
Date Mon, 21 Jul 2003 08:37:41 GMT
Hi,

I have a question. How can I use variables declared in other pieces of java
code withing my JSP within a <c:if> piece of code?

example:

<%
  int i = 5;
  * now to a sql call with sql tags and get some results *
  <c:if test="${row.ID == i}">
    etc.
%>

I cannot get that row.ID == i to work. Also tried <%= i %>, but that causes
casting exceptions.

Alternatively, how can I make SQL results available to other pieces of Java.
At the moment I do a <c:set> and then the other code gets the variable from
the scope it was set to, but it seems a bit tedious... is there a shorter
way?

Thanks!

Charl


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


Mime
View raw message