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=<cut 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=?
<sqlaram 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.
code:
<sql:query var="data" dataSource="jdbc/SSDB">
select * from data where variable=<cut 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=?
<sqlaram 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.