Struts + XDoclet (webdoclet) and integration with Eclipse

admin 5

XDoclet and Eclipse

First we have to install the JBoss-IDE plug-in. In Eclipse, go to Help -> Software Updates -> Find and Install and select “Search for new features to install”. Add a new remote site with URL From here on the installation is straightforward, but if you need more help, you may want to look in the Quick Start Guide.

Now if you right-click on your project, you’ll notice some new menu items: “Run XDoclet”, “Run Packaging” and after seletion of “Properties”, you’ll see “XDoclet Configurations”. When you click on the latter, the XDoclet configurations associated to your project will become available:

JBoss-IDE in Eclipse

Warning: do not be alarmed if it is still empty, you start out with an empty configuration by default!

Now by right-clicking in the upper pane, you can add a configuration. We choose standard here, and select the Standard Web configuration (which corresponds to the webdoclet module). Similarly, one may choose Standard EJB when the ejbdoclet module is needed.

Right-click on the “webdoclet” module in the lower-left pane and choose “Add”. Here we can add tasks such as “strutsconfigxml” and “strutsvalidationxml”, which correspond to the entries in the Ant build file, of course! After adding these elements, we can select them in the lower-left pane and edit the associated attributes in the lower-rigth pane (double click on an attribute to change its value).

In my case, I merely had to adapt the “destDir” attribute of the “webdoclet” and “deploymentdescriptor” elements, the “mergeDir” attribute of “webdoclet” as well as the “dir” attribute of “fileset” to my project structure, but it may be cleaner to set all the attributes according to the above Ant build file excerpt.

These actions result in a build-xdoclet.xml file being added to your project. Going back to your project, you may now activate the “Run XDoclet”, which generates your web.xml, as well as your struts-config.xml. If you added “strutsvalidationxml” to your XDoclet configuration, the validation.xml is generated as well.

Tip: If you get errors during “Run XDoclet” (Can’t create a strutsconfigxml element under webdoclet…[cut]), you may have to add the xdoclet-apache-module-x.y.z.jar to your $ECLIPSE_HOME/plugins/org.jboss.ide.eclipse.xdoclet.core_x.y.z directory.

5 thoughts on “Struts + XDoclet (webdoclet) and integration with Eclipse

  1. Pingback: Tripods For Less
  2. Hi,
    I have some problem, how to generate tiles-def.xml using Xdoclet1.2.
    Please give me any suggestion regarding this issue ASAP.

Comments are closed.

Next Post

KC SDPL planning

In the next 6 to 12 months Knowledge Center Server Development & Programming Languages intends to deal with the themes listed below. The aim is to present at least a large part of those themes in various attractive ways such as presentations, work shops and discussions.