Feb. 6, 2011, 5:57 a.m.
posted by franni
Support for Custom Actions
WebSphere Studio has several features that help you work efficiently with tag libraries. The first involves declaratively specifying any of a group of standard tag libraries to be associated with a Web project. Through a simple check box, Studio will add the .tld files to the Web project, add the corresponding entries in the web.xml file, and update the projects Java build path to include the tag library jar file(s) (Figure, on the next page).
There is also easy support for mapping the tag libraries' URI to a physical .tld file in the Web Deployment Descriptor editor (Figure). This results in the corresponding entry in the web.xml file (Figure).
Most of the taglib support is within WebSphere Studio's JSP editor, called the page designer. This allows easy insertion of taglib descriptors as well as the custom tags.
The dialog shown in Figure is launched from the page properties dialog after selecting the JSP tab and clicking Add for the selected taglib directive tag. It provides a list of all tag libraries associated with the .war file. You can select any number of the available tag libraries and have the taglib directive(s) written for you. The nice thing about this directive, if your projects are large or complex, is that it shows you the available Custom tags associated with each tag library.
The final piece is the wizard to insert a custom tag. This is accessed via the JSP > Insert Custom menu item. It provides a list of all available (for that page) custom tags (Figure).
The content assist will then provide information about the available custom tag attributes. For more information, see Chapter 13.