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:
 


<servlet>
  <servlet-name>FbAvatar</servlet-name>
  <servlet-class>com.jsos.fb.FbAvatarServlet</servlet-class>
</servlet>

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


<servlet-mapping>
  <servlet-name>FbAvatar</servlet-name>
  <url-pattern>/servlet/fb</url-pattern>
</servlet-mapping>

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.:
 


<servlet>
  <servlet-name>FbAvatar</servlet-name>
  <servlet-class>com.jsos.Fb.FbAvatarServlet</servlet-class>
<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:

    Facebook avatar package:  fbavatarPackage.jar
 

 ©  Coldbeans     Comments?

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

     

Also in JSOS: