This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other Open Source Projects and the fly likes Does XDoclet generate a Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Does XDoclet generate a "default" deployment descriptor?" Watch "Does XDoclet generate a "default" deployment descriptor?" New topic
Author

Does XDoclet generate a "default" deployment descriptor?

Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I was wondering whether XDoclet creates a default deployment descriptor in case the source code doesn't contain any XDoclet tags?
For example, for a web project containing 5 servlet classes but no XDoclet tags, will XDoclet generate a web.xml with URL mappings for all the 5 classes using some pattern such as "servlet/<fully qualified class name>"?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
No. It would generate a stub web.xml with no servlet-mapping parameters. One the servlets that have @web.servlet will have mappings generates. If you don't tag the servlet, XDoclet assumes you will provide the details in
the servlet-mappings.xml merge file.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Thanks Norman. I wonder why XDoclet doesn't create default mappings (or provide an on/off flag for the same)... They should have access to the class hierarchy, right?
By the way, I noticed that your book is coming out in November -- it's already on my Amazon wishlist
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
If XDoclet generated defaults for everything in your source tree, you'd have to add tags to tell XDoclet NOT to generate things you don't want. That seems somewhat less intuitive to me and would make XDoclet a real pain in mixed development. I am working on a project that is migrating to XDoclet now. About half the EJBs are fully XDoclet generated and about half are not. It's much simpler (especially politically) to put the burden on the developers of the beans that ARE using XDoclet than to force the non-XDoclet bean owners to
add XDoclet tags.
That might not be terribly convincing, but I tried...

BTW, we are hoping the book will actually be available at the beginning of October. And, it should be available as an e-book through manning's MEAP program in the next couple weeks. Send me an email when you do get the book and let me know what you like and don't like about it.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Thanks again, Norman. I didn't think deep enough it seems.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does XDoclet generate a "default" deployment descriptor?