Hi,

I am trying to use XDoclet 2 to generate TLD files from my java source files. I 
downloaded xdoclet-plugins-1.0.3 and tried out the example "sample-web" which 
worked fine. Only problem is that the sample application doesn't demonstrate 
how to use inheritance with XDoclet 2.

Here is what I tried:

/**
 * Test of XDoclet 2 tag
 *
 * @jsp.tag name="xdoclettesttag"
 *          display-name="XDocletTestTag"
 *          body-content="JSP"
 *          description="Tag is testing xdoclet"
 *
 * @jsp.variable name-given="name"
 *               declare="true"
 *               scope="NESTED"
 *
 * @jsp.variable name-given="address"
 *               declare="false"
 *               scope="NESTED"
 *
 *

 */
public class XDocletTestTag extends TagSupport {

    private String name;
    private String address;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }


    public int doStartTag() throws JspException {
        return 0;
    }

    public int doAfterBody() throws JspException {
        return 0;
    }
}

/**
 * Test of XDoclet 2 tag
 *
 * @jsp.variable name-given="postCode"
 *               declare="true"
 *               scope="NESTED"
 *
 */

public class TestSubclassTag extends XDocletTestTag {

    private String postCode;

    public String getPostCode() {
        return postCode;
    }

    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }
}


This genereates the following TLD output:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 
1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd";>

<taglib>
  <tlib-version>myTaglib</tlib-version>
  <jsp-version>1.2</jsp-version>
  <short-name>my</short-name>
  <small-icon>dummyIcon</small-icon>
  <description>This is a test taglib whose tld file was generated by 
xdoclet.</description>
  <tag>
    <name>xdoclettesttag</name>
    
<tag-class>no.finntech.base.taglibs.XDocletTestTaglib.XDocletTestTag</tag-class>
    <body-content>JSP</body-content>
    <display-name>XDocletTestTag</display-name>
    <description>Tag is testing xdoclet</description>
    <variable>
      <name-given>name</name-given>
      <variable-class>java.lang.String</variable-class>
      <declare>true</declare>
      <scope>NESTED</scope>
    </variable>
    <variable>
      <name-given>address</name-given>
      <variable-class>java.lang.String</variable-class>
      <declare>false</declare>
      <scope>NESTED</scope>
    </variable>
  </tag>
</taglib>

My subclass is not included in the TLD. What have I done wrong here?

If someone has any examples where XDoclet is used for TLD generation I would be 
very grateful to see it!


Regards,

Asgaut Mjølne
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=52378&messageID=105692#105692


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to