Support for Custom Actions





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).

5. Ability to select tag libraries as Web project features.

graphics/11fig05.jpg

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).

6. JSP tag library references in the Web Deployment Descriptor editor.

graphics/11fig06.jpg

7. JSP tag library reference in web.xml file.

graphics/11fig07.jpg

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.

8. Insert taglib directive dialog.

graphics/11fig08.jpg

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).

9. Insert custom tag dialog in Page Designer.

graphics/11fig09.jpg

The content assist will then provide information about the available custom tag attributes. For more information, see Chapter 13.


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows