org.springframework.social.facebook.web
Class FacebookWebArgumentResolver

java.lang.Object
  extended by org.springframework.social.facebook.web.FacebookWebArgumentResolver
All Implemented Interfaces:
WebArgumentResolver

public class FacebookWebArgumentResolver
extends Object
implements WebArgumentResolver

Web argument resolver that resolves arguments annotated with FacebookCookieValue. When using Facebook's JavaScript API, the FB.init() call will set a cookie whose name is "fbs_{appId}" if the user is signed into Facebook and if they have granted the application permission to access their profile. This web argument resolver extracts that information from the cookie (if available) and supplies it to a controller handler method as String values. FacebookCookieValue is required by default. If the cookie value cannot be resolved and if the annotation is set to be required, an exception will be thrown indicating an illegal state. If the annotation is set to not be required, null will be returned.


Field Summary
 
Fields inherited from interface org.springframework.web.bind.support.WebArgumentResolver
UNRESOLVED
 
Constructor Summary
FacebookWebArgumentResolver(String appId, String appSecret)
          Construct a FacebookWebArgumentResolver given the Facebook app id and secret.
 
Method Summary
 Object resolveArgument(MethodParameter parameter, NativeWebRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacebookWebArgumentResolver

public FacebookWebArgumentResolver(String appId,
                                   String appSecret)
Construct a FacebookWebArgumentResolver given the Facebook app id and secret. The application secret will be used to verify the cookie signature.

Method Detail

resolveArgument

public Object resolveArgument(MethodParameter parameter,
                              NativeWebRequest request)
                       throws Exception
Specified by:
resolveArgument in interface WebArgumentResolver
Throws:
Exception