Announcement Announcement Module
Collapse
No announcement yet.
@RequestMapping of ProviderSigninController not resolved by my Roo app... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @RequestMapping of ProviderSigninController not resolved by my Roo app...

    Hello,

    I am trying to configure a ProviderSigninController controller but it seems my controller is not seen by the app.

    Here is my Spring social configuration:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
    	xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
    		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    
    	<bean id="connectionFactoryLocator" class="org.springframework.social.connect.support.ConnectionFactoryRegistry">
    		<property name="connectionFactories">
    			<list>
    				<ref bean="facebookConnectionFactory" />
    			</list>
    		</property>
    	</bean>
    	<bean id="facebookConnectionFactory" class="org.springframework.social.facebook.connect.FacebookConnectionFactory">
    		<constructor-arg value="${facebook.clientId}" />
    		<constructor-arg value="${facebook.clientSecret}" />
    	</bean>
    	<bean id="providerSignInController" class="org.springframework.social.connect.web.ProviderSignInController" autowire="constructor">
    		<property name="applicationUrl" value="${application.url}" />
    	</bean>
    	<bean id="usersConnectionRepository" class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository">
    		<constructor-arg ref="dataSource" />
    		<constructor-arg ref="connectionFactoryLocator" />
    		<constructor-arg ref="textEncryptor" />
    	</bean>
    	<bean id="signInAdapter" class="com.kadjoukor.web.SimpleSignInAdapter" autowire="constructor" />
    	<bean id="textEncryptor" class="org.springframework.security.crypto.encrypt.Encryptors" factory-method="noOpText" />
    </beans>
    Here is my form (from Thymeleaf template):
    Code:
    <form name="fb_signin" id="fb_signin" th:action="@{/signin/facebook}" method="POST">
    	<input id="submit" type="submit" value="login with fb" />
    	<input type="hidden" name="scope" value="publish_stream,user_photos,offline_access" />
    </form>
    I also have a webmvc-config.xml file in the web-inf directory. Here is a portion from it that might be a relevant:
    Code:
    <context:component-scan base-package="com.kadjoukor" use-default-filters="false">
    		<context:include-filter expression="org.springframework.stereotype.Controller" type="annotation" />
    	</context:component-scan>
    Somehow, when I click the above form, I always get a 404 indicating that the @RequestMapping is not resolved...

    Can anyone please help?

    Regards,

    Julien.

  • #2
    Hello,

    My problem was solved when I moved the following bean definition:

    Code:
    <bean id="providerSignInController" class="org.springframework.social.connect.web.ProviderSignInController" autowire="constructor">
    		<property name="applicationUrl" value="${application.url}" />
    	</bean>
    to webmvc-config.xml (instead of applicationContext-social.xml).

    Somehow, it seems controllers can only be defined in a spring config file located underneath WEB-INF...

    Regards,

    Julien.

    Comment

    Working...
    X