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

Discussion in 'Java' started by shahbaz, Oct 27, 2003.

  1. shahbaz

    shahbaz Guest

    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.
     
    shahbaz, Oct 27, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Crowther
    Replies:
    0
    Views:
    3,913
    Crowther
    Nov 19, 2003
  2. Raymond DeCampo

    Custom tags and <jsp:plugin> / <jsp:param>

    Raymond DeCampo, Feb 18, 2004, in forum: Java
    Replies:
    0
    Views:
    639
    Raymond DeCampo
    Feb 18, 2004
  3. Geathaa
    Replies:
    2
    Views:
    700
    Geathaa
    Jul 30, 2003
  4. ectoplasm
    Replies:
    12
    Views:
    646
    Zorro
    Jul 28, 2005
  5. Dave
    Replies:
    5
    Views:
    671
    John Bokma
    Apr 26, 2011
Loading...

Share This Page