Dewiniaeth
Dewiniaeth

Reputation: 1123

JSP Template tutorial. How do I use a jar file

I am trying to follow the tutorial for JSP Templates at: http://java.sun.com/developer/technicalArticles/javaserverpages/jsp_templates/

I am struggling to understand the <%@ taglib uri='/WEB-INF/tlds/template.tld' prefix='template' %> tag.

What is the template.tld file, where does this come from?

I have tried to download the Resourses file of source code but this just contains a src.jar file. How do I use this? I can't even open the file!?! How do I see the source code example?

Upvotes: 0

Views: 3686

Answers (2)

Martin Algesten
Martin Algesten

Reputation: 13620

A uri, a uniform resource identifier is not necessarily pointing to any existing resource. It is an identifier, compare with url which is a uniform resource locator which helps you locate something. In many XML contexts for instance, it simply declares a namespace.

Sometimes the uri does however point to a real resource that you can read to get more information.

In this case you are declaring a namespace template to use in your jsp code (such as <template:dosomething/>) - the uri matches a uri declaration for whatever is implementing your tag functionality and can be found inside a jar (jstl.jar or standard.jar, can't remember which).

Upvotes: 1

duffymo
duffymo

Reputation: 308938

It's in the jstl.jar. You need standard.jar and jstl.jar in your WEB-INF/lib for JSTL.

You can get what you need here:

http://tomcat.apache.org/taglibs/

Download the standard tag library and all its JARs; put them in your WEB-INF/lib directory.

Upvotes: 3

Related Questions