Я уже прочитал весенний социальный документ, но часть конфигурации основана на Java, но конфигурация моего проекта основана на xml. поэтому, пожалуйста, скажите мне, как config spring social в весеннем файле конфигурации xml. спасибо и извините за мой плохой английскийspring social xml config
1
A
ответ
0
Проводка кода и вопросов помогут нам предоставить вам лучшее решение. Обратитесь к ссылке ниже, может быть, это то, что вы ищете http://harmonicdevelopment.tumblr.com/post/13613051804/adding-spring-social-to-a-spring-mvc-and-spring
0
Посмотрите на пример XML-конфигурации
0
Вы должны создать файл XML социальной конфигурации, и вы должны импортируйте в файл root-context.xml. Кроме того, вы можете подумать о настройке своего приложения с помощью весенней безопасности. Это зависит от вашей архитектуры проекта.
Пример файла весной социальный 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>
Образец корня 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"/>
Смежные вопросы
- 1. Spring Social XML configuration
- 2. spring xml config
- 3. о spring social xml configuration
- 4. xml spring social xmlns: facebook
- 5. Spring security + spring social xml configuration
- 6. Spring Social Spring Security с проблемой java config на tomcat7
- 7. Spring xml config to java config converter
- 8. Spring Security XML Config Vs Java Config
- 9. Spring XML Config to Java Config
- 10. Spring XML в JAVA Config
- 11. Spring Social facebook + Spring Security
- 12. Импорт Java Config Bean в XML Config Spring 4.0.0.RELEASE
- 13. Spring 'AuthenticationManager требуется' xml config с Java annotation-config
- 14. Ввод SessionFactory из Spring XML-Config в Java-Config
- 15. Spring Social + Spring MVC + Maven
- 16. Spring @Autowire переменная экземпляра без xml config
- 17. spring security config xml to java
- 18. Смешивание Java Config и XML Spring 4
- 19. Конфигурация Spring xml config @Async без @Scheduled
- 20. Junit - загрузка Spring XML config через аннотации
- 21. Создать Guava TypeToken в Spring xml config?
- 22. Spring Config Client XML-эквивалент @RefreshScope
- 23. Spring Batch - Erro Config XML job - Date
- 24. Java Config для Spring Gemfire XML
- 25. Spring Social Twitter
- 26. Spring Social facebookConnected.jsp
- 27. Spring-social get access_token
- 28. Spring Social - интеграция Facebook
- 29. Spring social Twitter Api
- 30. Spring Social Facebook Войти
Просьба представить это на основе конфигурации кода или, в наименее, ссылка на него. Или еще лучше: прочитайте документацию о конфигурации на основе кода (http://static.springsource.org/spring-framework/docs/current/spring-framework-reference/html/beans.html#beans-java) и пример порта , –
@Seongju - добавив немного больше усилий в ваш вопрос, даст лучшие ответы. Вы читаете документацию, это хорошее начало. Теперь покажите, что вы пробовали, и вы обязательно получите хороший ответ. – Marijn