Results 1 to 4 of 4
  1. #1
    Eimo is offline Member
    Join Date
    Oct 2010
    Posts
    26
    Rep Power
    0

    Default JDBC and Custom Tag

    Hi,
    I'm creating a tag library descriptor for the custom tag and test the custom tag in JSP page.
    My question is: I have three files, .java, .tld, and .jsp.... I'm not sure where to place them and how to deploy my program???
    I opened a terminal and setup tomcat and created a table with information but I'm not sure how to show the information on the .jsp file. I've done the coding but if someone tell me how to execute it?

    Please advice.....

  2. #2
    Eimo is offline Member
    Join Date
    Oct 2010
    Posts
    26
    Rep Power
    0

    Default I Found out how to deploy, but having another problem :(

    Hi,
    I'm trying to execute my program and having this error,

    org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/Tags.tld: (line 3, col 6)
    org.apache.jasper.compiler.TldLocationsCache.init( TldLocationsCache.java:248)
    org.apache.jasper.compiler.TldLocationsCache.getLo cation(TldLocationsCache.java:219)
    org.apache.jasper.JspCompilationContext.getTldLoca tion(JspCompilationContext.java:530)
    org.apache.jasper.compiler.Parser.parseTaglibDirec tive(Parser.java:419)
    org.apache.jasper.compiler.Parser.parseDirective(P arser.java:476)
    org.apache.jasper.compiler.Parser.parseElements(Pa rser.java:1426)
    org.apache.jasper.compiler.Parser.parse(Parser.jav a:133)
    org.apache.jasper.compiler.ParserController.doPars e(ParserController.java:216)
    org.apache.jasper.compiler.ParserController.parse( ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(C ompiler.java:167)
    org.apache.jasper.compiler.Compiler.compile(Compil er.java:306)
    org.apache.jasper.compiler.Compiler.compile(Compil er.java:286)
    org.apache.jasper.compiler.Compiler.compile(Compil er.java:273)
    org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:566)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:803)

    IAccording to the error I have a problem in Tags.tld file... Here is the content:


    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>Tags</shortname>
    <info> Tags Library</info>
    <tag>
    <name>displayResultSetdata</name>
    <tag-class>taglibrary.GetDataTag</tag-class>
    <teiclass>taglibrary.DataAccess</teiclass>
    <bodycontent>JSP</bodycontent>
    <info>Get Data From the Books Database Database.</info>
    </tag>
    </taglib>

    Is there anything wrong in my file??? if yes..how should I fix it??

    Thank you

  3. #3
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    368
    Rep Power
    5

    Default

    try

    <tagclass>taglibrary.GetDataTag</tagclass>

    instead of

    <tag-class>taglibrary.GetDataTag</tag-class>

    TIP:
    while creating tags for this file, your IDE (e.g. Eclipse) can help you - just use mouse over some element (like <tag>) and yellow pop-up will show up with useful info like :

    <Tag >

    Content Model : (name, tagclass, teiclass?, bodycontent?,
    info?, attribute*)
    So this explains what elements you must have, and when you place them in you file, use mouse over again to show you what is expected within element like ...[0.9] number ...

    regards!

  4. #4
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    368
    Rep Power
    5

    Default

    Or you can download file:

    http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd

    put it in your project,
    and create your tag files from it using wizards in your IDE.
    (create XML file form DTD file)

    this way you may have more clear picture of what is it that you must conform to while creating your tld

Similar Threads

  1. Custom GUI...Help?!
    By wadhah.alhaddad in forum New To Java
    Replies: 1
    Last Post: 02-07-2010, 03:54 PM
  2. Replies: 0
    Last Post: 04-01-2008, 10:17 AM
  3. Custom tgs in JSP
    By ravian in forum New To Java
    Replies: 2
    Last Post: 12-29-2007, 05:05 PM
  4. Replies: 0
    Last Post: 09-28-2007, 12:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •