Java Reference
In-Depth Information
The next section to examine is the <tag> section. It describes the name of the tag and its asso-
ciated tag handler. It also says that the bodycontent for this tag is empty.
The next step is to copy this tld into a directory that can be referenced in the Web applica-
tion's deployment descriptor. For this example, create a directory
<SERVER_ROOT>/webapps/djs/WEB-INF/tlds/ and copy the tld into it.
The final step to deploy your tag library is to add the following section to your application's
web.xml file.
Now you can see your new tag in action. Listing 19.3 contains the source for the JSP that will
use your Hello tag.
<%@ taglib uri=”/djs” prefix=”djs” %>
<djs:hello /><br>
Now open your browser to the following URL:
You should see an image similar to Figure 19.2.
F IGURE 19.2
The Hello Tag Page.
Search WWH ::

Custom Search