Currently (M3) ConnectController's redirectToProviderConnect() method is private:
The problem is we can't override or set a custom redirect URL. The default method implementation assumes that after the domain we have a URL with a request mapping to /connect/{providerId}.Code:private String redirectToProviderConnect(String providerId) { return "redirect:/connect/" + providerId; }
For example, if my domain is http://mydomain.com and I'm trying to connect to Facebook, redirectToProvider() will redirect to http://mydomain.com/connect/facebook. This will work if you have a RequestMapping that matches such. However if in your web.xml you declared a different URL hierarchy for DispatcherServlet , then you'll run to HTTP status 404.
Assuming you have the following DispatcherServlet declaration:
When you allow the app to have access to your Facebook account, it will redirect back to http://mydomain.com/connect/facebook which doesn't exist. The right path is http://mydomain.com/myapp/connect/facebookCode:<servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>/myapp/*</url-pattern> </servlet-mapping>
This problem is similar to the following post http://forum.springsource.org/showth...rl()-protected


Reply With Quote
