614 CHAPTER 15 USING STRUTS, XDOCLET, AND OTHER TOOLS and instructions on how to implement it are documented at http://www.alistapart.com/ stories/alternate/. Basically, it uses JavaScript and cookies to disable or enable your preferred stylesheets. We ve used it on several projects and have found it very useful. After you ve set up the template and baseLayout definition to render multiple stylesheets, you can override the list in a child definition. One thing to note is
doesn t allow extension, so you have to replace the entire thing. The means that if all you want to do is add an additional stylesheet, you also have to include the original (default.css) stylesheet. In the mainMenu definition, you re using the Struts Menu (http://www.sourceforge.net/projects/ struts-menu) as your menuing system. This menu requires an additional stylesheet file as well as an additional JavaScript file. Therefore, you should replace the original lists with new ones:
Pretty slick huh? We ve used this technique for the last year and it s worked great. Tiles, XDoclet, and Forwards Using Tiles to assemble and define your pages can be quite handy, but how do you call these definitions? The easiest way to reference your Tiles definitions is using an ActionForward. When you add the Tiles plug-in to your Struts configuration file, a smart Tiles-aware processor is used to execute requests. This processor, named TilesRequestProcessor, subclasses the Struts default RequestProcessor to intercept calls to includes and forwards to see if the specified URI (path) is a definition name. To configure Tiles definition forwarding in your application, all you need to do is match up the path attribute of a with the nameattribute of a definition. For example, in struts-resume, the ResumeAction s search()method returns an ActionForward to a local named list: return mapping.findForward(”list”); This forward is defined in struts-config.xml for the ResumeAction class as follows:
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 yet.