я уже прочитал социальный документ весны, но часть конфигурации основана на Java, но конфигурация моего проекта основана на xml. поэтому, пожалуйста, скажите мне, как настроить Spring Social в Spring XML-файле конфигурации. спасибо и извините за мой плохой английский
Весенняя социальная конфигурация xml
comment
Пожалуйста, предоставьте этот конфиг на основе кода или, по крайней мере, ссылку на него. Или еще лучше: прочитайте документацию о настройке на основе кода (static.springsource.org/spring-framework/docs/current/) и сам портирует пример.
- person Slava Semushin   schedule 27.04.2012
comment
@Seongju - приложив немного больше усилий к вашему вопросу, вы получите лучшие ответы. Вы читаете документацию, это хорошее начало. Теперь покажите, что вы пробовали, и вы обязательно получите хороший отклик.
- person Marijn   schedule 27.04.2012
Ответы (3)
Публикация вашего кода и проблем поможет нам предоставить вам лучшее решение. Обратитесь к приведенной ниже ссылке, возможно, это то, что вы ищете " rel="nofollow">http://harmonicdevelopment.tumblr.com/post/13613051804/adding-spring-social-to-a-spring-mvc-and-spring
person
Usha
schedule
08.10.2012
Взгляните на пример конфигурации xml
person
user979051
schedule
19.02.2013
Вам нужно создать XML-файл социальной конфигурации и импортировать его в файл root-context.xml. Кроме того, вы можете подумать о настройке своего приложения с помощью Spring Security. Это зависит от архитектуры вашего проекта.
Пример файла конфигурации Spring Social 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:context="http://www.springframework.org/schema/context"
xmlns:social="http://www.springframework.org/schema/social"
xmlns:facebook="http://www.springframework.org/schema/social/facebook" xmlns:bean="http://java.sun.com/jsf/core"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/social http://www.springframework.org/schema/social/spring-social.xsd
http://www.springframework.org/schema/social/facebook http://www.springframework.org/schema/social/spring-social-facebook.xsd">
<!-- Ensures that configuration properties are read from a property file -->
<context:property-placeholder location="file:${sampleapp.appdir}/conf/appparam.txt"/>
<!--
Configures FB and Twitter support.
-->
<facebook:config app-id="${facebook.clientId}" app-secret="${facebook.clientSecret}" />
<!--
Configures the connection repository. This application uses JDBC
connection repository which saves connection details to database.
This repository uses the data source bean for obtaining database
connection.
-->
<social:jdbc-connection-repository data-source-ref="sampleappDS" connection-signup-ref="accountConnectionSignup"/>
<!--
This bean is custom account connection signup bean for your registeration logic.
-->
<bean id="accountConnectionSignup" class="com.sampleapp.social.AccountConnectionSignup"></bean>
<!--
This bean manages the connection flow between the account provider and
the example application.
-->
<bean id="connectController" class="org.springframework.social.connect.web.ConnectController" autowire="constructor">
<constructor-arg index="0" ref="connectionFactoryLocator"/>
<constructor-arg index="1" ref="connectionRepository"/>
</bean>
Sample root-context.xml :
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
<!-- Scan for Spring beans declared via annotations. -->
<context:component-scan base-package="com.sampleapp"/>
<context:annotation-config/>
<context:property-placeholder location="file:${sampleapp.appdir}/conf/appparam.txt"/>
<cache:annotation-driven/>
<!-- Root Context: defines shared resources visible to all other web components -->
<import resource="security-config.xml"/>
<import resource="classpath*:spring/bean-context.xml"/>
<import resource="classpath*:spring/persistence-config.xml"/>
<import resource="social-config.xml"/>
<aop:aspectj-autoproxy proxy-target-class="true"/>
person
erdoganonur
schedule
15.04.2015