Custom JSP taglib. This taglib lets you use something similar to global-forwards in Struts.
The main idea is very simple. Instead of using the hard coded strings for pages in jsp:forward and jsp:include tags you can use the
similar tags from this taglib where the page will be defined as a global (context) parameter for your web application.
For example, in your web.xml file you can define a context parameter error:
<context-param> <param-name>error</param-name> <param-value>/myerrorpage.jsp</param-value> </context-param> This parameter defines a real location for your page. And later in your application you can use this symbolic name error in your tags:
<%@ taglib uri="taglib.tld" prefix="g" %> <g:forward page="error"/> so this indirect reference lets you update your application much more easily. If ever you decide to change the target page that you use for these forwards you then only need to change the definitions in one file (web.xml). Tags are: forward forwards request to the the given page. Parameters are: 1) page Describes a name for context parameter.
redirect redirects request to the the given page. Parameters are: 1) page Describes a name for context parameter.
include includes the given page. Parameters are: 1) page Describes a name for context parameter.
for downloading: Library: globtag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|