我已經閱讀了spring社交文檔,但配置的一部分是基於Java的,但我的項目配置是基於xml的。所以請告訴我在spring xml配置文件中spring spring是如何配置的。謝謝你,對不起我的可憐的英語spring社交xml配置
1
A
回答
0
發佈你的代碼和問題將幫助我們爲你提供最好的解決方案。請參閱下面的鏈接可能是你正在尋找 http://harmonicdevelopment.tumblr.com/post/13613051804/adding-spring-social-to-a-spring-mvc-and-spring
0
0
你必須創建一個社交配置xml文件,你必須導入到您的root-context.xml文件中。此外,您可能會考慮使用spring安全性來配置您的應用程序。這取決於你的項目架構。
樣品春天社會的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社交XML配置
- 2. 使用XML配置的Spring社交和Spring安全性
- 3. 關於春季社交XML配置
- 4. Java配置到XML配置 - 春季社交
- 5. 社交配置適配器和社交配置有什麼區別?
- 6. Spring XML配置與XML配置
- 7. Spring AOP配置(XML)
- 8. Spring @Transactional配置xml
- 9. Spring Security XML配置
- 10. Spring bean配置xml
- 11. 在XML中配置春季社交的連接支持
- 12. Spring社交.NET OAuth混淆
- 13. 動態Laravel社交網站配置
- 14. Spring Boot with Spring社交Google提供商
- 15. Spring中的xml配置
- 16. 等效於Spring XML配置
- 17. Spring MVC ResourceBundleMessageSource XML配置
- 18. Spring JPA + Hibernate XML配置
- 19. Spring Statemachine和xml配置
- 20. 覆蓋Spring XML配置
- 21. Spring XML配置差異
- 22. Spring - 從xml到Java配置
- 23. Spring註解和XML配置
- 24. 在社交中配置connectionSignUp和jdbc-connection-repository元素在社交中使用spring-social
- 25. 配置Spring Security沒有在Spring XML 4
- 26. 如何在春季社交配置中配置回撥URL
- 27. 如何使用xml配置配置sockjs配置Spring 4 WebSocket
- 28. Spring社交Facebook:「OAuth2'狀態'參數不匹配」
- 29. Spring Boot starter社交Facebook添加權限
- 30. 與Wicket一起使用spring社交
請提供這基於代碼的配置,或者在最少,鏈接到它。或者甚至更好:閱讀關於基於代碼的配置的文檔(http://static.springsource.org/spring-framework/docs/current/spring-framework-reference/html/beans.html#beans-java)以及他自己的port例子。 – 2012-04-27 06:39:23
@Sejuju - 在你的問題上多加點努力會產生更好的迴應。你閱讀文檔,這是一個好的開始。現在展示你的嘗試,你一定會得到很好的迴應。 – Marijn 2012-04-27 07:40:26