At least for weblogic, precompilation of JSP's can be handled by a separate ANT task. The servlet mappings in web.xml are the same whether or not they're precompiled.


<!-- Weblogic application compiler --> <taskdef
name="wlappc"
classname="weblogic.ant.taskdefs.j2ee.Appc"
classpathref="project.class.path"
/>


       <wlappc
             source="${dist.dir}/${ear.name}"
             compiler="jikes"
             classpathref="project.class.path"
       />

HTH,
Ben

Andrew Stevens wrote:

On Thu, 2003-06-05 at 21:53, Fan, Hong wrote:


Thanks. Is there an existing example I can refer?



Well, the samples include a couple of merge files; they're for jboss and weblogic, but it shows the basic idea i.e. set the mergedir parameter of your subtask (deploymentdescriptor in your case) to the directory containing the merge files(*).

The generated docs in the CVS version should say what all the merge
points are for the subtasks, and what they expect in them.  For the
servlet.xml merge point, it's "An XML unparsed entity containing the
servlet elements for any additional servlets not processed by XDoclet."
(**)  For servlet-mappings.xml, it's "An XML unparsed entity containing
the servlet-mapping elements for any additional servlets not processed
by XDoclet."

I assume you know what the <servlet> and <servlet-mapping> elements are
that you need to be merged in.  If not, then to be frank you're probably
using the wrong tool (and/or need to read through a J2EE tutorial
first).  XDoclet makes life much simpler by generating interfaces,
deployment descriptors, etc. instead of maintaining them by hand, but we
still expect you to know what is it you need it to generate.  After all,
how else will you be able to tell if it's doing it correctly? :-)


Andrew.


(*) or directory of the root package in the hierarchy if it's a per-bean
merge point; these need to use the same package hierarchy as the beans
themselves in order to avoid potential name clashes.
(**) "What's an XML unparsed entity?", I hear someone ask... Basically,
an XML fragment, but unlike an XML Document it needn't be well-formed. For many of the merge points, this may be the case as they could include
more than one of a repeating element (and with no single root element it
can't be well-formed, hence not an XML document by strict definition). A subtle distinction, and somewhat pedantic, but I figured the docs
might as well be accurate in their terminology :-)




-----Original Message-----
From: Andrew Stevens [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 4:22 PM
To: [EMAIL PROTECTED]
Subject: Re: [Xdoclet-user] add precompile jsp->servlet mapping in
web.xml using XDoclet


On Thu, 2003-06-05 at 19:47, Fan, Hong wrote:


I am new in Xdoclet. I have a need to precompile all JSP pages into
servlets and puts corresponding servlet mapping into the web.xml. Can
someone suggest how to add these servlet mapping in web.xml using
XDoclet?


Since xdoclet only processes java files, not JSPs, you need to use a
merge file to add these.  In this particular case, you'll want to use
the servlets.xml merge point to add the appropriate <servlet> elements
into the deployment descriptor.  You'll probably want to use the
servlet-mappings.xml merge point to add <servlet-mapping> elements for
them, too.


Andrew.





------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user







-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to