Class FacebookWebArgumentResolver

  extended by
All Implemented Interfaces:

public class FacebookWebArgumentResolver
extends java.lang.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
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(MethodParameter parameter, 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(MethodParameter parameter,
                                        NativeWebRequest request)
                                 throws java.lang.Exception
Specified by:
resolveArgument in interface WebArgumentResolver