6

我尝试了使用 XML 的 Spring Social Showcase,但它似乎在 XML 中有错误。

XML 文件不工作。我已经阅读了第 23 到 27 行的 x 标记。

<facebook:config app-id="${facebook.clientId}" app-secret="${facebook.clientSecret}" app-namespace="socialshowcase" />
    <twitter:config app-id="${twitter.consumerKey}" app-secret="${twitter.consumerSecret}"/>
    <linkedin:config app-id="${linkedin.consumerKey}" app-secret="${linkedin.consumerSecret}"/>

    <social:jdbc-connection-repository/>

我试图检查架构(http://www.springframework.org/schema/social/)并将其粘贴到 URL 中,但它说它没有找到。我试图检查 springframework.org/schema/ 的根目录,但找不到与 Spring Social 相关的孩子。

春季社交的 xmnls 或模式位置是否有新链接?

这是我的 XML 文件:

<?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:facebook="http://www.springframework.org/schema/social/facebook"
    xmlns:twitter="http://www.springframework.org/schema/social/twitter"
    xmlns:social="http://www.springframework.org/schema/social"
    xmlns:linkedin="http://www.springframework.org/schema/social/linkedin"
    xmlns:c="http://www.springframework.org/schema/c"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/social/facebook http://www.springframework.org/schema/social/spring-social-facebook.xsd
        http://www.springframework.org/schema/social/linkedin http://www.springframework.org/schema/social/spring-social-linkedin.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/social/twitter http://www.springframework.org/schema/social/spring-social-twitter.xsd
        http://www.springframework.org/schema/social http://www.springframework.org/schema/social/spring-social.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">



    <context:property-placeholder location="classpath:/org/springframework/social/showcase/config/application.properties" />



    <facebook:config app-id="${facebook.clientId}" app-secret="${facebook.clientSecret}" app-namespace="socialshowcase" />
    <twitter:config app-id="${twitter.consumerKey}" app-secret="${twitter.consumerSecret}"/>
    <linkedin:config app-id="${linkedin.consumerKey}" app-secret="${linkedin.consumerSecret}"/>

    <social:jdbc-connection-repository/>    
    <bean id="userIdSource" class="org.springframework.social.security.AuthenticationNameUserIdSource" />

    <bean id="connectController" class="org.springframework.social.connect.web.ConnectController" autowire="constructor">
        <property name="connectInterceptors">
            <list>
                <bean class="org.springframework.social.showcase.facebook.PostToWallAfterConnectInterceptor" />
                <bean class="org.springframework.social.showcase.twitter.TweetAfterConnectInterceptor" />
            </list>
        </property>
    </bean>

    <bean id="psc" class="org.springframework.social.connect.web.ProviderSignInController" autowire="constructor" />        
    <bean id="signInAdapter" class="org.springframework.social.showcase.signin.SimpleSignInAdapter" autowire="constructor" />

    <bean id="disconnectController" class="org.springframework.social.facebook.web.DisconnectController" 
        c:_0-ref="usersConnectionRepository" c:_1="${facebook.clientSecret}" />

</beans>
4

2 回答 2

1

自从提出问题以来已经有一段时间了,但我现在遇到了同样的问题。

我只是通过将 Spring-Social-Security jar 添加到我的构建路径来修复它。使用行家:

<dependency>
  <groupId>org.springframework.social</groupId>
  <artifactId>spring-social-security</artifactId>
  <version>${org.springframework.social-version}</version>
</dependency>
于 2013-10-22T09:27:39.060 回答
1

尝试改变这部分

<bean id="connectController" class="org.springframework.social.connect.web.ConnectController" autowire="constructor">
    <property name="connectInterceptors">
        <list>
            <bean class="org.springframework.social.showcase.facebook.PostToWallAfterConnectInterceptor" />
            <bean class="org.springframework.social.showcase.twitter.TweetAfterConnectInterceptor" />
        </list>
    </property></bean>

    <bean class="org.springframework.social.web.connect.ConnectController">
<constructor-arg value="${application.url}" /></bean>
于 2014-01-14T15:49:38.107 回答