Return-Path: Delivered-To: apmail-jakarta-taglibs-user-archive@jakarta.apache.org Received: (qmail 73084 invoked by uid 500); 20 Mar 2001 12:15:05 -0000 Mailing-List: contact taglibs-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: taglibs-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list taglibs-user@jakarta.apache.org Delivered-To: moderator for taglibs-user@jakarta.apache.org Received: (qmail 91360 invoked from network); 19 Mar 2001 17:57:36 -0000 Message-ID: <20010319175738.63637.qmail@web12401.mail.yahoo.com> Date: Mon, 19 Mar 2001 09:57:38 -0800 (PST) From: Morgan Delagrange Reply-To: mdelagra@eb.com Subject: Re: Newbie problems with JDBC taglib To: taglibs-user@jakarta.apache.org In-Reply-To: <3AB382BF.15083D58@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N --- Steve Philp wrote: > I'm having a problem using the JDBC taglib > (031701.tar.gz, but also > tried 031601.tar.gz) that I'm hoping someone can > help me out with... > > The page looks like: > > <%@ taglib > uri="http://jakarta.apache.org/taglibs/jdbc" > prefix="sql" %> > > > > > > jndiName="java:comp/env/jdbc/advdb"/> > > > > SELECT > CSCODE, > CSNAME > FROM > CUSTOMER > WHERE > CSNAME LIKE ? > AND SACODE IN (?) > AND CSTYPE = 'A' > ORDER BY 2 > > > > > <%=request.getParameter("Customer") + "%" %> > > position="2">4 > > > > > > > > > >
Customer NameAvailable Reports
position="1"/> position="2"/>
> > > > When I execute that page under Resin 1.2.1 (IBM JDK > 1.3 on Linux) I get > the following error: > > java.lang.NoSuchMethodError: > javax.servlet.jsp.tagext.TagData: method > getAttributes()Ljava/util/Enumeration; not found > at > org.apache.taglibs.jdbc.resultset.BaseGetterTEI.isValid(BaseGetterTEI.java:78) > at > com.caucho.jsp.JspGenerator.generateMyTag(JspGenerator.java:747) > at > com.caucho.jsp.JspGenerator.generateTaglib(JspGenerator.java:713) > at > com.caucho.jsp.JspGenerator.generateChildren(JspGenerator.java:679) > at > com.caucho.jsp.JavaGenerator.printTagInstance(JavaGenerator.java:634) > at > com.caucho.jsp.JspGenerator.generateMyTag(JspGenerator.java:769) > at > com.caucho.jsp.JspGenerator.generateTaglib(JspGenerator.java:713) > at > com.caucho.jsp.JspGenerator.generateChildren(JspGenerator.java:679) > at > com.caucho.jsp.JavaGenerator.printTagInstance(JavaGenerator.java:634) > at > com.caucho.jsp.JspGenerator.generateMyTag(JspGenerator.java:769) > at > com.caucho.jsp.JspGenerator.generateTaglib(JspGenerator.java:713) > at > com.caucho.jsp.JspGenerator.generateChildren(JspGenerator.java:679) > at > com.caucho.jsp.JspGenerator.generate(JspGenerator.java:237) > at > com.caucho.jsp.JspParser.parse(JspParser.java:213) > at > com.caucho.jsp.JspParser.parse(JspParser.java:149) > at > com.caucho.jsp.XtpPage.getJspPage(XtpPage.java:482) > at > com.caucho.jsp.XtpPage.compileJspPage(XtpPage.java:338) > at > com.caucho.jsp.XtpPage.subservice(XtpPage.java:204) > at > com.caucho.jsp.Page.service(Page.java:334) > at > com.caucho.server.http.Invocation.service(Invocation.java:255) > at > com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:201) > at > com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:217) > at > com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:151) > at > com.caucho.server.TcpConnection.run(TcpConnection.java:140) > at java.lang.Thread.run(Thread.java:498) > > > What am I doing wrong? I'm not familiar with Resin, but it looks like your JSP engine is missing a feature. If you look at the Javadocs for Resin: http://www.caucho.com/products/resin/javadoc/javax/servlet/jsp/tagext/TagData.html it is missing the getAttributes() method proscribed by the Servlet 2.2 API: http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/tagext/TagData.html Solution: if you're familiar enough with Servlets and tag libraries, you could download the current CVS, remove the isValid() method from the BaseGetterTEI class, and build your own version of the tag. Just keep an eye on your usage, since that method performs valuable validation of the "colName" and "position" attributes of the getter tags. > > The other problem that I ran across was that the > documentation showed > the connection attribute would work as: > > jndiName="java:comp/env/jdbc/advdb"> > > but that gets me an error about an unknown attribute > "jndiname" (yes, > the 'n' switched case). Change the connection tags > to: > > > > java:comp/env/jdbc/advdb > > > gets it working correctly. Tried both the 3/16 and > 3/17 nightlies just > to see if it was a bug that'd been ironed out since > my download. Good catch. I introduced an error when I changed the capitalization of the jndiName attribute. It should work after tonight's build, or feel free to build it from source. > Thanks for any help you can provide! > > -- > Steve Philp, MCSE/MCP+I > Assistant IS Manager > Advance Packaging Corporation > sphilp@ameritech.net ===== Morgan Delagrange Britannica.com __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/