JSF tld newbie Question

C

Carlos

Hello all,
I was looking at the JSF implementation source and some sample JSPs
from sun. I was wondering how/where the tld files are referenced/found.

For example the tld file html_basic.tld is jarred in the jsf-impl.jar.
In a jsf page it is imported with <%@ taglib prefix="h"
uri="http://java.sun.com/jsf/html" %>. Now there does not seem to be
any reference to the uri mapping in the web.xml or faces-config.xml or
anywhere else to the above uri.

So how does the application know that uri="http://java.sun.com/jsf/html"
references html_basic.tld?
Thanks
 
R

Ryan Stewart

Carlos said:
Hello all,
I was looking at the JSF implementation source and some sample JSPs from
sun. I was wondering how/where the tld files are referenced/found.

For example the tld file html_basic.tld is jarred in the jsf-impl.jar. In a
jsf page it is imported with <%@ taglib prefix="h"
uri="http://java.sun.com/jsf/html" %>. Now there does not seem to be any
reference to the uri mapping in the web.xml or faces-config.xml or anywhere
else to the above uri.

So how does the application know that uri="http://java.sun.com/jsf/html"
references html_basic.tld?
Thanks
Section 7.3 of the JSP specification, while somewhat confusing on the first
read, indicates that a TLD placed in the META-INF directory of a JAR file or one
of its subdirectories will be found, and the uri declared in it will be made
available for use. It doesn't quite come out and say it that concisely, but
that's what it comes down to. In other words, your html_basic.tld declares a
<uri> element "http://java.sun.com/jsf/html". Because the TLD file is in the
JAR, presumably somewhere in the META-INF directory, your application can use
that absolute URI.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top