On Wed, 2004-02-04 at 02:56, Kazys J wrote:
> I am trying to generate web.xml descriptor for servlets.
> It works fine if servlet directly descends from HttpServlet.
> 
> But in case it extends JUnitEEServlet then only servlet mapping tag is 
> produced and the servlet tag is missing.
>
> I did read the manual and browse the mailing list archives. It suggests I 
> should include junitee.jar (containing JUnitEEServlet.class) in the 
> webdoclet.
> 
> So I did like this: 
> 
>       <taskdef name="webdoclet" classname="xdoclet.modules.web.WebDocletTask">
>               <classpath>
>                       <fileset dir="${xdoclet.lib.dir}">
>                               <include name="*.jar"/>
>                       </fileset>
>                       <pathelement 
> path="/usr/local/jboss/server/default/lib/javax.servlet.jar"/>
>                       <pathelement path="/usr/local/junitee/lib/junitee.jar"/>
>               </classpath>
>       </taskdef>

Sounds good so far.

The reason you need to include the junitee.jar in the taskdef's
classpath is that if you don't. although the parser knows that your
classes extend JUnitEEServlet, it doesn't know that JUnitEEServlet
extends HttpServlet; since it therefore doesn't know that your class
extends HttpServlet, it will get skipped by the subtask.

Same principle applies for Struts actions, form beans, etc. which don't
extend the standard ones.  You need to make sure the taskdef's classpath
includes everything needed to trace through the inheritence hierarchy to
the classes the subtask(s) the subtask is searching for.

Note that if your classes extend other classes in your own source files,
that doesn't mean you need to add those to the taskdef's classpath, but
you do need to make sure they're also included in the fileset you're
using.

> it still does not generate servlet tag in web.xml

Hmm...

> I even copied junitee.jar to xdoclet/lib no luck

Not necessary.  The classpath you're using above ought to be enough.

> Any ideas?

Probably the same reason Barelas isn't getting anything generated from
his EJBs ("Can't generate code" thread).  Check your fileset is rooted
at the base of your package hierarchy.  i.e. if your classes are
com.foo.Bar etc. then your fileset should be

<fileset dir="<directory containing 'com'>">
  <include name="**/*.java"/>
</fileset>

If that doesn't do the trick, post the relevant bits from the build
script and one of your classes which is being ignored.


Andrew.



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to