Presented by developerWorks, your source for great tutorials
ibm.com/developerWorks
compile:
[javac] Compiling 2 source files to
C:\tutorials\J2EEXdoclet\webdoclet\web\WEB INF\classes
generateDD:
[webdoclet] Running 
[webdoclet] Generating web.xml.
package:
[war] Building war: C:\tutorials\J2EEXdoclet\webdoclet\tmp\war\webdoclet.war
deploy:
[copy] Copying 1 file to C:\tomcat4\webapps
BUILD SUCCESSFUL
Total time: 13 seconds
Now that you have deployed it let s test it. Go to
http://localhost:8080/webdoclet/BasicServlet
. You may have to adjust the port number
and/or context depending on your app server.
You should get a browser that looks like this:
Now open up the
build.properties
file and change the following properties like so:
basic.servlet.hi=I love XDoclet
basic.servlet.bye=Feel the power of XDoclet
Next, if you have an IDE like Eclipse that supports refactoring, change the package
name of the Servlet to com.foobar.ibm. Now rerun the ant build file as before (run the
clean target first then the deploy), and rerun the application. You see: The
web.xml
file
is in sync with the new changes. See the power. You are free to change the name or
package of the class as needed. XDoclet will keep the
web.xml
file in sync. Feel the
Enhance J2EE component reuse with XDoclets
Page 19 of 49






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