Album taglib ver. 1.8

    Custom JSP taglib. Tag imagesGrid lets you publish pictures. Tag outputs all the graphical files from the given directory. For the each image tag shows a thumbnail with a link to servlet displays the full image. It is a quick way to create images gallery in your web applications.

For example:
 


<%@ taglib uri="taglib.tld" prefix="im" %>

<im:imagesGrid dir="c:/data/images/"/>

Directory with pictures could be anywhere on your server, even the outside of your web application. By default tag uses a special servlet for getting images. If data directory is located under your web application tree than you can use HTML img tag for getting images.

In order to use this taglib with build-in servlet you have to describe it also in your web.xml file:
 


<servlet>
  <servlet-name>showImage</servlet-name>
  <servlet-class>com.cj.album.showImage</servlet-class>
</servlet>


<servlet-mapping>
  <servlet-name>showImage</servlet-name>
  <url-pattern>/servlet/showImage</url-pattern>
</servlet-mapping>

Tags are:

imagesGrid

Outputs a table (grid) of graphical files (.gif, .jpg, jpeg, .png, .bmp) from the given directory. Parameters are:

1) dir Optional parameter. Describes a path to source directory. By default it will be a current directory.
2) col Optional parameter. Describes a size for grid: pictures per row. Default value is 5.
3) width Optional parameter. Describes a width for thumbnails (in pixels). Default value is 100.
4) height Optional parameter. Describes a height for thumbnails (in pixels). Default value is 50.
5) space Optional parameter. Describes a space between pictures in your grid. Default value is 20.
6) border Optional parameter. Describes a border for thumbnails. Default value is 1.
7) showNames Optional parameter. Describes a toggle: show/do not show titles (short file names) for pictures. Possible values are true or false. Default value is true (show titles).
8) showImages Optional parameter. Describes a toggle: show/do not show images (pictures). Possible values are true or false. Default value is true (show images).
9) useServlet Optional parameter. Describes a toggle: use/do not use build-in servlet for getting images (pictures). Possible values are true or false. Default value is true (use servlet for getting images).
10) target Optional parameter. Describes a target frame for the full image demonstration. Default value is _blank (show picture in the new browser's window)
11) order Optional parameter. Describes an order: 1 - alphabetical, 2 - last modified time ascend, 3 - last modified time descend. Default value is 1.
12) rel Optional parameter. Describes a rel attribute for links to images.

Note: the evaluation version displays up to 10 files.

for downloading:

Library: albumtag.jar    Description: taglib.tld

© Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: