QR code servlet ver. 1.1

This servlet lets you produce QR codes for links. Internally servlet uses Google Charts API and caches data for the better performance.

How to use this servlet:

a) download qrcodePackage.jar and save it in WEB-INF/lib

b) describe this servlet in web.xml file. Servlet accepts the following initial parameters:
dir - Describes an existing directory on your server for the saved content
proxyHost - Optional parameter. Describes a proxy host for your internet connection
proxyPort - Optional parameter. Describes a proxy port for your internet connection
width - Optional parameter. Describes a width for the image. Default value is 300
height - Optional parameter. Describes a height for the image. Default value is 300

For example:
 


<servlet>
  <servlet-name>QRCodeServlet</servlet-name>
  <servlet-class>com.jsos.qr.QRCodeServlet</servlet-class>
  <init-param>
   <param-name>dir</param-name>
   <param-value>/my_cache</param-value>
  </init-param>
</servlet>

c) describe a mapping for this servlet in web.xml file. E.g.:
 


<servlet-mapping>
  <servlet-name>QRCodeServlet</servlet-name>
  <url-pattern>/servlet/qrcode</url-pattern>
</servlet-mapping>

and now in your applications you can use servlet in the following forms
 


/servlet/qrcode?your_url

e.g. /servlet/qrcode?http://www.servletsuite.com

and you will get the following image:

http://www.servletsuite.com

You can describe the proxy settings for the servlet itself. Parameters are proxyHost and proxyPort. E.g.:
 


<servlet>
  <servlet-name>QRCodeServlet</servlet-name>
  <servlet-class>com.jsos.qr.QRCodeServlet</servlet-class>
  <init-param>
   <param-name>dir</param-name>
   <param-value>/my_cache</param-value>
  </init-param>

  <init-param>
   <param-name>proxyHost</param-name>
   <param-value>192.168.0.1</param-value>
  </init-param>

  <init-param>
   <param-name>proxyPort</param-name>
   <param-value>8080</param-value>
  </init-param>
</servlet>

   For downloading:

    QR code servlet:  qrcodePackage.jar
 

 ©  Coldbeans     Comments?

See also JSOS - the largest collection of servlets and filters.

Also in JSOS: