JavaServer Page

October 25, 2006

CHAPTER 15 USING STRUTS, XDOCLET, AND OTHER

Filed under: JavaServer Page — webmaster @ 5:17 pm

620 CHAPTER 15 USING STRUTS, XDOCLET, AND OTHER TOOLS Since the development of modules is very similar to developing a standard Struts application, we ll show you how to set them up, and we ve actually implemented an upload feature that uses them in the struts-resume application. The setup is rather simple, consisting of the following three steps: 1. Prepare a config file for your module. 2. Inform the controller of the module. 3. Use forwards or actions to switch to your new module. We won t detail the first step here, because this is the same as creating a new Struts application. You could probably use XDoclet to create your configuration files for the different modules, but you would have to coax your Ant webdoclet task to output struts-config.xml to different directories. Of course, the purpose of submodules is to make development and configuration easier, and XDoclet already does this for you! The second step involves adding a new init parameter to the ActionServlet s definition in the application s deployment descriptor, web.xml. In the struts-resume application, this configuration is located at metadata/web/servlets.xml: action org.apache.struts.action.ActionServlet
config /WEB-INF/struts-config.xml

config/upload /WEB-INF/struts-upload.xml

debug 2

detail 2
2 This configuration indicates that there are two modules in this application the default module, which has no forward slash (/) in its name, and the second, our upload feature. The configuration files for both modules are located in the WEB-INF directory. The recommended standard for naming module configuration files is struts-module.xml. While you re looking at the ActionServlet s configuration, we want to point out a few changes between 1.0 and 1.1/1.2. In 1.0, it was common practice to specify the ResourceBundle

Note: If you are looking for good and high quality web space to host and run your jsp application check Lunarwebhost jsp web hosting services

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.

Powered by Java Web Hosting