JSP custom taglib lets you create QR codes in your JSP page. Taglib is a
wrapper for Google Charts API. Each tag creates an URL for the image with QR code. For example:
<%@ taglib uri="taglib.tld" prefix="q" %>
<q:QR_URL id="url">
http://www.servletsuite.com
</q:QR_URL>
<img src="<%=url%>" alt="QR code"/>
and you will get some like this:
Tags are:
QR_URL
Body tag creates QR code for the URL in tag's body. By default (empty body) the current page's
URL will be used. Attributes are:
1) width Optional attribute. Describes a width for QR code.
Default value is 300
2) height Optional attribute. Describes a height for QR code.
Default value is 300
3) id Optional attribute. Describes a name for the page scope variable
(type is java.lang.String). This variable will keep the URL for the generated image.
Without this attribute tag simply prints data.
QR_Dial
Body tag creates QR code for the phone number dialing. Tag's body presents phone number. Attributes are:
1) width Optional attribute. Describes a width for QR code.
Default value is 300
2) height Optional attribute. Describes a height for QR code.
Default value is 300
3) id Optional attribute. Describes a name for the page scope variable
(type is java.lang.String). This variable will keep the URL for the generated image.
Without this attribute tag simply prints data.
QR_SMS
Body tag creates QR code for sending SMS. Tag's body presents the message. Attributes are:
1) phone Describes a phone number.
2) width Optional attribute. Describes a width for QR code.
Default value is 300
3) height Optional attribute. Describes a height for QR code.
Default value is 300
4) id Optional attribute. Describes a name for the page scope variable
(type is java.lang.String). This variable will keep the URL for the generated image.
Without this attribute tag simply prints data.
QR_BKM
Body tag creates QR code for bookmarks. Tag's body presents an URL. Attributes are:
1) title Describes a title.
2) width Optional attribute. Describes a width for QR code.
Default value is 300
3) height Optional attribute. Describes a height for QR code.
Default value is 300
4) id Optional attribute. Describes a name for the page scope variable
(type is java.lang.String). This variable will keep the URL for the generated image.
Without this attribute tag simply prints data.
for downloading:
Library: qrcodetag.jar Description: taglib.tld
© Coldbeans
Comments?
See also Coldtags suite - the largest collection of custom JSP tags.
|