----- Original Message ----- 
From: "Schwartz, David (CHR)" <[EMAIL PROTECTED]>
To: "'Tomcat Users List'" <[EMAIL PROTECTED]>
Sent: Wednesday, June 04, 2003 1:55 PM
Subject: RE: JSTL and EL question - SOLVED


> I'm still having problems. Can you please post a complete sample along with
> web.xml sample?

What exactly are your problems?

In web.xml you should declare taglibs:

 <taglib>
  <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
  <taglib-location>/WEB-INF/c.tld</taglib-location>
 </taglib>
 <taglib>
  <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
  <taglib-location>/WEB-INF/sql.tld</taglib-location>
 </taglib>
 
 <resource-ref>
  <res-ref-name>jdbc/EVracunDS</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
 </resource-ref>

And then use this in your JSP:

<sql:setDataSource dataSource="EVracunDS"/>
<sql:query var="userData">
  SELECT * FROM user_tab WHERE user_id = ?
  <sql:param value="${userID}"/>
</sql:query>
...
<c:set var="userRow" value="${userData.rows[0]}"/>
<c:out value="${userRow.user_id}"/>
...

Nix.

Reply via email to