using param or out tag inside sql tag (jsp/jstl/tomcat)

S

shahbaz

I'm going a little crazy with this, let's say i have the following
code:
<sql:query var="data" dataSource="jdbc/SSDB">
select * from data where variable=<c:eek:ut value="${params.type}"/>
</sql:query>
In this case, the out tag just seems to get ignored!

<sql:query var="data" dataSource="jdbc/SSDB">
select * from data where variable=?
<sql:param value="${params.type}" />
</sql:query>
In this case I get an invalid column exception. The last method is
what I prefer to use (seems cleaner) and in the online tutorial at
sun, the param tag is usable even in a simple query tag (rather than
just prepared queries).

The thing is, I had method one working some time ago when I was using
an older version of tomcat. Now I'm using Tomcat 5.0.12. I setup the
tag libs the following way:
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/sql.tld" prefix="sql" %>
When I look inside sql.tld, I get the following info:
<description>JSTL 1.1 sql library</description>
<display-name>JSTL sql</display-name>
<tlib-version>1.1</tlib-version>
<short-name>sql</short-name>
<uri>http://java.sun.com/jsp/jstl/sql</uri>
(the fact that there are c.tld, c-1_0.tld and c-1_0-rt.tld is too
confusing, so I just put relative url and tld name in jsp).

In my frustration, I set the <rtexprvalue>true</rtexprvalue> tag to
true in the <name>query</name> section of sql.tld.

Any idea what's going on here??? Thanks.

Shahbaz C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top