Spring Social Facebook

Class FacebookWebArgumentResolver

  extended by org.springframework.social.facebook.web.FacebookWebArgumentResolver
All Implemented Interfaces:

public class FacebookWebArgumentResolver
extends java.lang.Object
implements org.springframework.web.bind.support.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.

Craig Walls

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

Constructor Detail


public FacebookWebArgumentResolver(java.lang.String appId,
                                   java.lang.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


public java.lang.Object resolveArgument(org.springframework.core.MethodParameter parameter,
                                        org.springframework.web.context.request.NativeWebRequest request)
                                 throws java.lang.Exception
Specified by:
resolveArgument in interface org.springframework.web.bind.support.WebArgumentResolver

Spring Social Facebook