ibm.com/developerWorks
Presented by developerWorks, your source for great tutorials
/** ...
* @web.resource ref description="JDBC resource"
*
name="jdbc/mydb"
*
type="javax.sql.DataSource"
*
auth="Container"
...
*/
public class BasicServlet extends HttpServlet {
The above generate the following elements in the
web.xml
file:
...
JDBC resource
jdbc/mydb
javax.sql.DataSource
Container
Using the
webdoclet
task to generate Web
application deployment descriptors
This is all fine and dandy, but how do you take the Java source files with the fancy
JavaDoc like tags and generate the
web.xml
file? For this, you need to write an Ant
build file that uses the
webdoclet
task from XDoclet.
The
webdoclet
task is an Ant task for generating all manner of support files. For this
example you will use the
deploymentdescriptor
subtask. But before you do this you
have to setup XDoclet to be accessible from your Ant scripts. While you are setting up
XDoclet, you might as well setup your environment.
Before you can run the
webdoclet
task you need to setup your environment with
XDoclet and Ant. This will require installing and configuring XDoclet. And, then letting
your Ant build file know about your application server configuration.
To do all of this you will need to:
1. Install XDoclet
2. Download and install the example
3. Configure the example to find your XDoclet install
4. Configure the example to find your application server s live deploy directory
Page 14 of 49
Enhance J2EE component reuse with XDoclets






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

j2ee web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved