Manage this page

0. Feedback

1. Display

Links

JSP and Aspire page

Satya - Wednesday, February 09, 2005 3:18:17 PM

What is a good reference for JSTL?

1. JSTL page at Sun

2. A JSTL primer + expression language

3. A JSTL primer part 2: flow etc

Not sure how good the above links are. I will post a future note when I find out.

Satya - Thursday, February 10, 2005 8:52:52 AM

How can I tell an appserver to recompile all JSPs?

When an included jsp file gets changed it might not trigger a compile of the parent files.

How can I tell an appserver to do that? Is there a way to set the mode so that all the dependent files are recompiled? Or is there a way to force a recompile short of deleting the jsp temp directory.

Satya - Thursday, November 10, 2005 3:33:03 PM

How are tld files located?

On the jsp page you specify a "taglib" directive and idenfity a "uri" and a "prefix"

taglib
   uri: string
   prefix: string

Based on the uri the web.xml will have a node

taglib
   taglib-uri
   taglib-location: /web-inf/taglib.tld

The taglib location can point to a jar file as well ex:

/WEB-INF/lib/taglibs-mailer.jar

Satya - Thursday, November 10, 2005 3:51:03 PM

Basic tag lib examples

Basic tag lib examples

Satya - Thursday, November 10, 2005 4:01:04 PM

Apache taglibs home

apache taglibs home

Satya - Thursday, November 10, 2005 4:21:35 PM

Packaging tld files

These can be placed as children of the meta-inf sub directory in the jar file. In 1.1 only one tld is allowed. Multiple tlds are allowed in 1.2 spec.

They can also be in a sub directory of the meta-inf

They can also be in the web-inf or a subdirectory of it. It is not recommended that they are in web-inf/lib or web-inf/classes.

The tld path that goes into the web.xml should be pointing to a jar or a relative path starting the web app root.

Satya - Thursday, November 10, 2005 4:27:13 PM

Implicit map entries from tld files

tld files will be loaded from web-inf and its sub directories. They will also be loaded from all the jar files with in web-inf/lib directory.

Implication is that you don't have to specify the taglib maps as long as they are in the jar file. The "uri" that is present in the tlds will perform the binding. It is possible some containers may still require an explicit web.xml binding from a uri to a tld file.

Satya - Thursday, November 10, 2005 4:32:07 PM

Where are these tld rules discussed?

Get the JSP 2.0 specification and look for

7.3.1 Identifying tag library descriptors

Satya - Saturday, March 04, 2006 9:09:12 AM

How to forward a request

RequestDispatcher dispatcher 
    = request.getRequestDispatcher(relativeUrl);
dispatcher.forward(request, aResponse);

Here are more details about forward in the api

Satya - Saturday, March 04, 2006 9:09:49 AM

More rules of the forward

forward should be called before the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward.

Satya - Saturday, March 04, 2006 9:11:13 AM

The path of the forward

The pathname specified to the request dispatcher may be relative, although it cannot extend outside the current servlet context. If the path begins with a "/" it is interpreted as relative to the current context root. This method returns null if the servlet container cannot return a RequestDispatcher.