Facebook avatar servlet ver. 1.1

This servlet lets you display profile images from Facebook in your applications.

How to use this servlet:

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

b) describe this servlet in web.xml file. Servlet accepts the following initial parameters (optional):
proxyHost - Optional parameter. Describes a proxy host for your internet connection
proxyPort - Optional parameter. Describes a proxy port for your internet connection
defaultURL - Optional parameter. Describes a default URL for avatars

For example:


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


and now in your applications you can use it in your applications in the following form: /servlet/fb?name=screen_name_or_id_from_facebook. In other words you should provide screen name (or ID) from Facebook as a parameter name. For example:

<img src="http://host/servlet/fb?name=zuck">

Optionally you can set another parameter size. It describes the size for avatar. Possible values are small or large. Default value is small.

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



   For downloading:

    Facebook avatar package:  fbavatarPackage.jar

 ©  Coldbeans     Comments?

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


Also in JSOS: