JavaServer Page

October 25, 2006

CHAPTER 15 USING STRUTS, XDOCLET, AND OTHER

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

CHAPTER 15 USING STRUTS, XDOCLET, AND OTHER TOOLS 621 for messages as an application init parameter. We used this setting, as well as the nocache init parameter. In Struts 1.1, these settings have been deprecated and moved to a element in the struts-config.xml file. The following setting can be found in metadata/web/ struts-controller.xml: The nocachesetting tells the controller to add HTTP headers to prevent caching of content it s off by default. You can also specify a forwardPattern attribute, such as WEB-INF/pages/$M$P, where the $M variable indicates the module prefix and $P indicates the pathattribute of the selected element, although it isn t used here. The inputForward attribute allows you to use local or global forwards in the inputattribute of an action mapping. This is a very handy and much needed feature. Note More information on optional values and their meanings can be found online at http:// struts.apache.org/userGuide/configuration.html. The application s ResourceBundle is now specified in a element in struts-config.xml. If you re using XDoclet, you can place this in a struts-message-resources.xml file. In the struts-resume application, this file is located in the same location as the rest of the Struts configuration fragments: Since we keep this file (ApplicationResources.properties) directory under WEB-INF/ classes, there is no need to specify a package name. You can also specify alternate resource bundles for the application by adding a second element and specifying a key attribute: This can be useful if, for instance, you re building a product using Struts and you only want to expose a minimal amount of options that customers may change. To use this ResourceBundle with the tag, you only need to specify a bundleattribute that matches the key: Now that you ve seen how to set up modules for an application, let s see how to switch between them. For demonstration purposes, we ve added an upload module to struts-resume for uploading r sum s. This module doesn t demonstrate much more than file upload and module switching. It could be developed into a feature that allows for simple uploading of existing r sum s, but not much more than that. At the time of writing, there are two basic techniques to switching modules. The first involves using a forward (global or local) with a

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