Custom JSP taglib. Mimics HTML hyperlinks (<a> tag) with the specified URL but opens the target location in the separate popup window. In other words you can keep users (visitors) on the main page while opening a new location. There are two options for filling that popup: iframe or Ajax call. For example, the following code will open your link in the iframe: For example:
<script language="JavaScript" src="cjajax.js"></script> <%@ taglib uri="taglib.tld" prefix="wl" %> <html> ... <wl:winlink iframe="true" title="Google about Coldbeans" href="http://www.google.com/search?q=Coldbeans">Google about Coldbeans</wl:winlink> ... </html> And you will get some like this: Google about Coldbeans Otherwise (without the attribute iframe) the target site will be requested via Ajax and returned HTML displayed in the popup window.
E.g. in this case:
<script language="JavaScript" src="cjajax.js"></script> <%@ taglib uri="taglib.tld" prefix="wl" %> ... <wl:winlink href="/servlet/Next">Next Step</wl:winlink> ... tag will request /servlet/Next and displays the response in in the popup window. Tag supports sessions, so URL rewriting will be added automatically. Also tag lets you add a random unique parameter to the generated link (a standard trick for non-cached requests). In order to use this tag with Ajax you have to describe an external JavaScript file cjajax.js on your page. You can set a text for your hyperlink as a tag's body or through
the special tag setText. Tag setParameter lets you define a GET parameter for the link
(value will be encoded automatically):
<%@ taglib uri="taglib.tld" prefix="wl" %> <html> ... <wl:winlink href="http://www.server.com/nextpage.htm"> <wl:setText>Next page</wl:setText> <wl:setParameter name="A">value for A</wl:setParameter> <wl:setParameter name="B">value for B</wl:setParameter> </wl:winlink> ... </html> Tags are: winlink Body tag renders HTML hyperlink that will be opened in the window. Parameters are: 1) href Optional parameter. Describes an URL. By default
tag will use the current URL (request URI).
setText Body tag defines a text for your hyperlink. Parameters are: none setParameter Body tag defines a parameter for your hyperlink. Parameters are: 1) name Describes a name for your parameter for downloading: Library: winlinktag.jar Description: taglib.tld JavaScript library: cjajax.js See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|