----- Original Message ----- From: "Schwartz, David (CHR)" <[EMAIL PROTECTED]> To: "'Tomcat Users List'" <[EMAIL PROTECTED]> Sent: Wednesday, June 04, 2003 3:35 PM Subject: RE: JSTL and EL question - SOLVED
> can you also send the taglib line from the top of jsp? Sure, look below. > 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: <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %> > <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.
