Configuration XML spring security
Bonjour à tous :),
j'aimerais configurer mon projet pour qu'il utilise Spring Security. J'ai déjà un fichier spring.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
<?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:tx="http://www.springframework.org/schema/tx"
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-4.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
<tx:annotation-driven/>
<context:component-scan base-package="palinfo.com.monProjet.dao"></context:component-scan>
<context:component-scan base-package="palinfo.com.monProjet.service"></context:component-scan>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3307/maBase" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>
<bean id="hibernateAnnotatedSessionFactory"
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="annotatedClasses">
<list>
<value>palinfo.com.monProjet.model.Utilisateur</value>
<value>palinfo.com.monProjet.model.Perso</value>
<value>palinfo.com.monProjet.model.Mdp</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="current_session_context_class">thread</prop>
<prop key="show_sql">false</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="hibernateAnnotatedSessionFactory"></property>
</bean>
</beans> |
Mais en lisant la doc : http://docs.spring.io/spring-securit...ity-config-xml
J'ai cru comprendre que je devrai utiliser un autre fichier XML nommé security.xml
Est-ce obligatoire ou est-ce que je peux insérer tout ça dans mon spring.xml de base ?
Merci d'avance.