Topics

 

Introduction

To top of page

These guidelines describe when to use JSP custom tags, how to model them, and some applicable design considerations.

For more information on JSP custom tags, see Concepts: Java Server Page Custom Tag.

 

Identifying JSP Custom Tags

To top of page

JSP custom tags are simple Java classes implementing the glue between Java implementation and the JSP pages. Custom tags are ways of minimizing the use of Java code appearing in JSP pages. In projects where Java development and Web design must be separated, JSP custom tags can eliminate Java code from the JSP page, hiding the Java code from the Web designers.

 

Modeling JSP Custom Tags

To top of page

JSP custom tags are modeled as simple Java classes. In UML, the stereotype <<JSPTag>> distinguishes them from other Java classes.

Example UML diagram showing JSPTag

 

Concurrency

To top of page

Tag handlers are used by one thread at a time (unlike, for instance, Servlets); however, there may be multiple threads operating on different instances of custom tags. A developer should be careful accessing shared resources (such as static data) to avoid concurrency problems.

 

Cleanup

To top of page

Tag handlers may be pooled and reused by the Web container. If resources are required, they should be created in doStartTag() and the developer should implement release() to cleanup the resources before reuse.




This content developed or partially developed by Inferdata Corporation.

Rational Unified Process  

2003.06.13