On Tue, 2003-07-15 at 16:21, robert lazarski wrote:
> On Mon, 2003-07-14 at 21:13, robert lazarski wrote:
> > > I need to load on startup a servlet inside a utility jar. Since I am not
> > > installing the app and invoking ant in production, I cannot put the needed
> > > tags in by hand. Is merge points the answer? Is "Examine the existing .xdt
> > > files to learn the template language.", and creating something from 
> scatch,
> > > the only way to go?
> 
> > The subject mentions pre-compiled servlets.  Are you saying you've got a
> > ready-built war that you want to add a DD to, and there's no source
> > files to put the @tags in?  If so, then you might as well just write the
> > DD by hand yourself and add it to the jar with the update option (jar
> > uvf mywebapp.war WEB-INF/web.xml).
> >
> > It may be possible to have XDoclet generate the DD solely using the
> > merge points, but what would be the advantage?  All it would be doing is
> > stringing various merge files together, and you could do that just as
> > well with Ant's <concat> task, or 'cat' at a shell prompt.  Probably run
> > faster, too :-)
> >
> >
> > Andrew.
> 
> Thanks for the reply, although I should have been more clear. 
> 
> Yes, the servlet is precompiled, and exists inside a jar. Its purpose is to 
> load a resource.  
> 
> I am building the war - that is _not_  ready built. 
> 
> I have servlets of my own, and Webdoclet is doing nicely what I need for those 
> - generate a web.xml file with <servlet> and <init-param> . The Webdoclet 
> generated war with the Webdoclet web.xml works fine. 
> 
> Except, I _still_ need to get the <servlet> and <init-param> for the 
> precompiled servlet, that exists in a prebuilt jar 
> (myWarGeneratedWithWebdoclet.war/WEB-INF/lib/prebuilt_and_precompiled_servlet.jar) 
> inside the web.xml file somehow. That's the problem. 

Okay, I'm with you now.  The answer is merge points.  See
http://xdoclet.sourceforge.net/ant/xdoclet/modules/web/WebXmlSubTask.html#Merge%20Files

In particular, you'll need the servlets.xml one (include the whole
servlet element for the prebuilt servlet).  You'll probably need
servlet-mappings.xml as well, assuming you want to map a URL pattern to
it too.

> Could ant concat do this? Is this a common problem already solved? 

Forget concat.  I only suggested that because I thought you were trying
to generate the entire web.xml without any source files of your own. 
For including extra "third-party" servlets/EJBs/etc. in the DDs you're
generating for your own stuff, merge files are the way to go.


Andrew.



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to