Source Code: JSP Custom Tag Example

An example of encapsulating complex presentation functionality into a custom tag. This example demonstrates a custom tag that allows the user to select tables and columns from the database.

File name Description
com/salmonllc/examples/example2/DBSelector.java A encapsulated Html Component that creates the GUI for the selector.
com/salmonllc/examples/example2/DBSelectorTag.java A custom tag handler that exposes the component so it can be used in a JSP page.
example2/DBSelector.jsp A page that contains the custom tag.
WEB-INF/example.tld A file describing the custom tags in your library (required by the J2EE spec).
WEB-INF/web.xml The web.xml file for your application requires an entry for each tag library. Take a look at the bottom of the file for the description of the tld above.


Return to Home Page
Run the Example