facebook

JSP Tag Library Problem

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #269420 Reply

    lylam
    Member

    I’m new in using MyEclipse.
    When I imported a tag library from my vendor, an error occurred.
    Please help.

    My installation are shown below:
    Eclipse 3.2.2
    MyEclipse Version: 5.1.1 GA (Build id: 20070302-5.1.1-GA)

    I started with a Web Project,
    create directory /WEB-INF/config/taglibs,
    and import a tag library bbUI.tld and a supporting file bbUI.xls into the ./taglibs directory.
    The system reported almost immediately an error in the bbUI.tld file.

    When I opened the bbUI.tld with the MyEclipse editor, a red cross labelled the line with <taglib>. I extract the core part of the file below for easy reference.

    === File Begin ========================================

    <?xml version=”1.0″ encoding=”ISO-8859-1″?>
    <?xml-stylesheet type=”text/xsl” href=”bbUI.xsl”?>

    <!DOCTYPE taglib
    PUBLIC “-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN”
    http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd”&gt;

    <taglib>

    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>bbUI</short-name>
    <uri>/bbUI</uri>
    <description>
    The Blackboard User Interface tag library encapsulates Blackboard user interface
    elements to allow developers easy access to the Blackboard look and feel
    </description>

    <tag>
    <name>loginWelcome</name>
    <tag-class>blackboard.servlet.tags.LoginWelcomeTag</tag-class>
    <body-content>empty</body-content>
    <description>Creates the standard login welcome panel.</description>
    <attribute>
    <name>errorMessage</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>Error message from previous login attempt</description>
    </attribute>
    </tag>

    ….

    <function>
    <name>FilterHtml</name>
    <function-class>blackboard.util.XSSUtil</function-class>
    <function-signature>java.lang.String filter( java.lang.String)</function-signature>
    <description>
    The FilterJs function provides JSTL-accessible support for filtering HTML
    fragments for dangerous Javascript:
    – script tags and all event-handlers are disabled.
    – object, embed, and applet tags are left unaltered.
    – form, input and textarea tags are disabled.
    – src, href and similar attributes are filtered.
    </description>
    </function>

    </taglib>

    === File End ========================================

    The error message tells the following:
    The content of element type “taglib” must match “(tlib-version,jsp-version,short-name,uri?,display-name?,small-icon?,large-icon?,description?,validator?,listener*,tag+)”.

    When I removed the sections with the “function” tag, the error message went away. Obviously, the tag group”function” is an alien to “taglib”. Since the tag library is from vendor, it is improper to alter it.

    Please advise what I can do in MyEclipse to make them compatible so that a workable .war file may be generated.

    #269450 Reply

    Riyad Kalla
    Member

    lylam,
    MyEclipse will still generate a WAR file correctly for you when you deploy your application. Actually if you don’t want to edit this TLD at all even if it’s incorrect, you can simply right-click on it, go down to MyEclipse > Exclude from Validation, and not worry about the file anymore.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: JSP Tag Library Problem

You must be logged in to post in the forum log in