Writing a Custom JSP Tag Library

Yesterday you learned about the support provided by Java to embed special tags in an HTML file that allowed you to include Java code in the HTML file. This hybrid HTML file, called a JavaServer Page, was then parsed and compiled by the JSP engine in the WebLogic Server to generate a servlet.

The special tags that you could add are defined in the JSP specification. Suppose you wanted to add your own tags. Would you be able to do so? For example, to display the name of the logged-in user, typically you would use the expression tag <%=myName%> to retrieve the name from a Java variable. It would be much more intuitive to a developer to use your own tag called <name/>. The second tag is easier to understand (because ...

Get Sams Teach Yourself BEA WebLogic Server 7.0™ in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.