O'Reilly logo

JavaServer Faces by Hans Bergsten

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deploying the Custom Tag Library

You can deploy the custom tag library two different ways: you can deploy it as separate files in the web application structure, or package all files in a JAR file and deploy the JAR file. During development, it’s often convenient to deploy the files separately, because it makes it easier to replace updated class files or the TLD. Just place the TLD somewhere under the application’s WEB-INF directory, for example, in a subdirectory named WEB-INF/tlds. Put the tag handler class files under WEB-INF/classes using a directory structure that matches the package structure, such as WEB-INF/classes/com/mycompany/jsf/taglib for the ValidateLaterThanTag in Example 7-7.

For production deployment, it’s better to package all tag library files in a JAR file. The TLD goes in the JAR file’s META-INF directory, and the class files in a directory structure mirroring the package structure: for example, META-INF/taglib.tld and com/mycompany/jsf/taglib/ValidateLaterThanTag.class for the example tag library. To deploy the library, put the JAR file in the application’s WEB-INF/lib directory.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required