Return-Path: Delivered-To: apmail-jakarta-taglibs-user-archive@jakarta.apache.org Received: (qmail 75266 invoked by uid 500); 15 Apr 2001 21:13:36 -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 86926 invoked from network); 14 Apr 2001 00:43:24 -0000 X-Authentication-Warning: new-smtp2.ihug.com.au: Host p46-max12.syd.ihug.com.au [203.173.155.174] claimed to be voyager From: "Anthony Ikeda" To: , Subject: RE: AW: Newbie Question Date: Sat, 14 Apr 2001 10:44:03 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <20010413184210.21982.qmail@web12407.mail.yahoo.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N I just noticed this disucssion and what I find here has me totally confused!!! The denotes a virtual mapping to the file in the tag. You use the as the reference on a JSP page. The concept is the same used for servlet mapping. You defina e servlet with a name, you use this name to create a mapping. The mapping then goes back from the servlet name to the servlet class to get the class: url-mapping -> servletName -> servlet class uri -> uri-location -> tag The URI doesn't need to be absolute, it can be called anything you want provided it links up to the TLD file referenced under the same name as in the web.xml file. so: personalTags /WEB-INF/tlds/myOwnTags.tld You then reference this as: <%@ taglib uri="personalTags" prefix="itWorks"%> In theory the taglib-location can point to any location (eg http://www.home.com/tags/tag.tld, http://home.org/coolTags/numericProcessTags.tld) but the is what identifies the taglib entry. If you want the servlet example: theBestServletEver com.home.servlets.BestServlet theBestServletEver /myBest/servletEver/* The is the same as the it just identifies it for use anywhere inside the web application. The example below presented by Stefan: <%@ taglib uri="/WEB-INF/jdbc.tld" prefix="sql"%> is syntactically correct for an absolute uri but therefore does not really need declaration in the web.xml file. Kind of pointless if you have a dynamic system that may require the reference to be updated across n number of pages. ie if you change the tld filename (say to jdbcExt.tld) you would need to go through each page that references this file and update it. With the web.xml reference, it only needs to be updated once. Has this made it any clearer for those who didn't follow the comments below? Sorry if I've iterated much of what may have been saif (and no offense intended) but I thought it would be easier presenting the Servlet API standard (which many seem to overlook). Cheers, Anthony Ikeda Web Application Developer, Proxima Technology Sydney Australia -----Original Message----- From: Morgan Delagrange [mailto:mdelagra@yahoo.com] Sent: Saturday, 14 April 2001 4:42 AM To: taglibs-user@jakarta.apache.org Subject: Re: AW: Newbie Question Yup, that's the real problem. Sorry. --- Stefan Riegel wrote: > Hello Morgan, hello Amar, > > isn't their another error in the code of Amar? > > If I understood the thing right (I am newbie too), > the "taglib-uri-Tag" > defines a sort of placeholder for the real location, > which is defined in the > "taglib-location-Tag". > > Amar wrote > http://***java***.apache.org/taglibs/jdbc > but > refers to ***jakarta***.apache.org/taglibs/jdbc in > the JSP-Page. > > The JSP Container doesn't find the specified URI in > the web.xml and takes > the URI itself (http://jakarta.apache...) as the > default location for the > tag library descriptor file. Because their isn't the > TLD, the container > produces the error. > > I think it is less complicated, if one uses the > default location like > <%@ taglib uri="/WEB-INF/jdbc.tld" prefix="sql" > %> > for learning or testing purpose. I use some Jakarta > Taglibs without any > -Entry in the web.xml. > > > Regards > Stefan Riegel > > > > -----Ursprungliche Nachricht----- > > Von: Morgan Delagrange [mailto:mdelagra@yahoo.com] > > Gesendet: Donnerstag, 12. April 2001 21:17 > > An: taglibs-user@jakarta.apache.org > > Betreff: Re: Newbie Question > > > > > > I would think that would work, but you might want > to > > try this in your web.xml instead: > > > > > > > > > http://java.apache.org/taglibs/jdbc > > > > jdbc.tld > > > > > > Also, as a point of information, this line > shouldn't > > be necessary if you only access the database via > the > > tag library: > > > > > <%@ page language="java" import="java.sql.*, > > > oracle.jdbc.driver.*" %> > > > > --- Dummy Amar > > wrote: > > > Hi, > > > > > > I downloaded the JDBC taglib directory and > following > > > the direction copied > > > the jdbc.tld file under the /WEB-INF directory > and > > > jdbc.jar under > > > /WEB-INF/lib directory. I also created an entry > in > > > the /WEB_INF/web.xml > > > like > > > > > > > > > > http://java.apache.org/taglibs/jdbc > > > > > > > /WEB-INF/jdbc.tld > > > > > > > > > After that I tried the following JSP page > > > > > > <%@ page language="java" import="java.sql.*, > > > oracle.jdbc.driver.*" %> > > > <%@ taglib > > > uri="http://jakarta.apache.org/taglibs/jdbc" > > > prefix="sql" %> > > > > > > <%-- open a database connection --%> > > > > > > > > > > > > jdbc:oracle:thin:@oak.stgeorgeconsulting.com:1521:ser > > verName > > > > > > > > > oracle.jdbc.driver.OracleDriver > > > > > > <%-- optional --%> > > > Usernmae > > > > > > <%-- optional --%> > > > password > > > > > > > > > > > > > > > <%-- close a database connection --%> > > > > > > > > > I am receiving the following error message > > > > > > org.apache.jasper.JasperException: Unable to > open > > > taglibrary > > > http://jakarta.apache.org/taglibs/jdbc : Could > not > > > locate TLD > > > META-INF/taglib.tld > > > at > > > > > > org.apache.jasper.compiler.JspParseEventListener.handleDirecti > > ve(JspParseEventListener.java:672) > > > at > > > > > > org.apache.jasper.compiler.DelegatingListener.handleDirective( > DelegatingListener.java:116) > > > at > > > > > > org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215) > > > at > > > > > > org.apache.jasper.compiler.Parser.parse(Parser.java:1073) > > > at > > > > > > org.apache.jasper.compiler.Parser.parse(Parser.java:1038) > > > at > > > > > > org.apache.jasper.compiler.Parser.parse(Parser.java:1034) > > > at > > > > > > org.apache.jasper.compiler.Compiler.compile(Compiler.java:182) > > > at > > > > > > org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413) > > > at > > > > > > org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfN > > ecessary(JspServlet.java:149) > > > at > > > > > > org.apache.jasper.runtime.JspServlet$JspServletWrapper.service > > (JspServlet.java:161) > > > at > > > > > > org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet > > .java:261) > > > at > > > > > > org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369) > > > at > > > > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > > at > > > > > > org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWra > > pper.java:503) > > > at > > > > > > org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) > > > at > > > > > > org.apache.tomcat.service.http.HttpConnectionHandler.processCo > > nnection(HttpConnectionHandler.java:160) > > > at > > > > > > org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEnd > > point.java:338) > > > at java.lang.Thread.run(Thread.java:484) > > > > > > Please help. > > > > > > Thanks in advance > > > Amar Das > > > > > > > > > ===== > > Morgan Delagrange > > Britannica.com > > > > __________________________________________________ > > Do You Yahoo!? > > Get email at your own domain with Yahoo! Mail. > > http://personal.mail.yahoo.com/ > > > ===== Morgan Delagrange Britannica.com __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/