SSH Integration Applicationcontext.xml configuration file

Source: Internet
Author: User

<?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:aop= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP"
xmlns:tx= "Http://www.springframework.org/schema/tx"
xmlns:jpa= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/DATA/JPA"
xmlns:jaxws= "Http://cxf.apache.org/jaxws"
       
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.xsd
HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP
http://www.springframework.org/schema/aop/spring-aop.xsd
Http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/DATA/JPA
http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
Http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
">

<context:property-placeholder location= "Classpath:db.properties"/>
<!--data Source-
<bean id= "DataSource" class= "Com.mchange.v2.c3p0.ComboPooledDataSource" >
<property name= "Driverclass" value= "${jdbc.driverclass}" ></property>
<property name= "Jdbcurl" value= "${jdbc.url}" ></property>
<property name= "user" value= "${jdbc.user}" ></property>
<property name= "Password" value= "${jdbc.password}" ></property>
</bean>

<!--Spring Integration Hibernate offers sessionfactory --
<!--<bean id= "sessionfactory" class= "Org.springframework.orm.hibernate5.LocalSessionFactoryBean" >
<property name= "DataSource" ref= "DataSource" ></property>
You can also inject hibernate configuration information by
<property name= "Hibernateproperties" >
<props>
<prop key= "Hibernate.dialect" >org.hibernate.dialect.Oracle10gDialect</prop>
<prop key= "Hibernate.hbm2ddl.auto" >update</prop>
<prop key= "Hibernate.show_sql" >true</prop>
<prop key= "Hibernate.format_sql" >true</prop>
</props>
</property>
Scan the package for JPA entities
<property name= "Packagestoscan" >
<value>com.itheima.bos.domain</value>
</property>
</bean>

<!--Spring integration JPA --
<bean id= "Entitymanagerfactory" class= "Org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" >
<property name= "DataSource" ref= "DataSource"/>
<!--scan entity package paths --
<property name= "Packagestoscan" value= "Com.itheima.bos.domain"/>
<!--Specifies that the persistence layer provider is hibernate--
<property name= "Persistenceprovider" >
<bean class= "Org.hibernate.ejb.HibernatePersistence"/>
</property>
<property name= "Jpavendoradapter" >
<bean class= "Org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" >
<!--auto-build Table -
<property name= "Generateddl" value= "true"/>
<property name= "Showsql" value= "true"/>
<property name= "Database" value= "ORACLE"/>
<property name= "Databaseplatform" value= "Org.hibernate.dialect.Oracle10gDialect"/>
</bean>
</property>
<property name= "Jpadialect" >
<bean class= "Org.springframework.orm.jpa.vendor.HibernateJpaDialect"/>
</property>
</bean>

<!--configuration transaction manager -
<bean id= "TransactionManager" class= "Org.springframework.orm.jpa.JpaTransactionManager" >
<property name= "Entitymanagerfactory" ref= "Entitymanagerfactory" ></property>
</bean>

<!--annotation Management transactions --
<tx:annotation-driven transaction-manager= "TransactionManager" proxy-target-class= "true"/>

<!--spring-data integration JPA: Free DAO layer, scan DAO Layer Pack--
<jpa:repositories base-package= "Com.itheima.bos.dao" ></jpa:repositories>

<!--component Scanning, identifying annotations--
<context:component-scan base-package= "Com.itheima.bos"/>
    
<!--Configure objects that call the CRM client remotely--
<jaxws:client id= "customerclient" address= "http://192.168.48.50:9091/bos_crm/service/customer?wsdl"
serviceclass= "Com.itheima.bos.crm.service.CustomerService" >
</jaxws:client>

<!--release order service --
<bean id= "OrderService" class= "com.itheima.bos.service.take_delivery. Orderserviceimpl "/>
<!--configuring CXF service-side objects--
<jaxws:server id= "Bos" address= "/order" >
<jaxws:serviceBean>
<ref bean= "OrderService"/>
</jaxws:serviceBean>
</jaxws:server>

<!--Shiro Environment configuration --
<!--Configuring Realm objects --
<bean id= "Bosrealm" class= "Com.itheima.bos.realm.BosRealm" ></bean>
<!--configuring Shiro Security Manager Objects--
<bean id= "SecurityManager" class= "Org.apache.shiro.web.mgt.DefaultWebSecurityManager" >
<!--Inject Realm objects --
<property name= "Realm" ref= "Bosrealm" ></property>
<!--inject cache manager --
<property name= "CacheManager" ref= "CacheManager" ></property>
</bean>

<!--configuring Ehcache Cache Manager Objects --
<bean id= "CacheManager" class= "Org.apache.shiro.cache.ehcache.EhCacheManager" >
<!--inject Ehcache profile: Configure cache Policy --
<property name= "Cachemanagerconfigfile" value= "Classpath:ehcache.xml" ></property>
</bean>

<!--Configure Shiro filter factory for managing permissions--
<bean id= "Shirofilter" class= "Org.apache.shiro.spring.web.ShiroFilterFactoryBean" >
<!--inject security manager --
<property name= "SecurityManager" ref= "SecurityManager" ></property>
<!--The Loginurl property is used for URL interception authorization, when a user is not logged in and accesses a resource that needs to be logged in to access, jumps to the page that is configured later-
<property name= "loginurl" value= "/login.jsp" ></property>
<!--The Unauthotizedurl property is used for URL interception authorization, if a user accesses an unauthorized resource, jumps to the page that is configured later-
<property name= "Unauthorizedurl" value= "/unauthorized.jsp" ></property>
<!--inject filter chain --
<property name= "Filterchaindefinitions" >
<value>
<!--
/**: Indicates more requests
AUTHC: Indicates authentication through to access
Anon: Anonymous filter, no user authentication required to access, often used to access static resources and login interface and methods for logging
perms: Permission filter, parameters can have multiple, indicating that the current user must have all the included permissions to access the corresponding URL or method
Roles: Role filter, parameters can have multiple, indicating that the current user must have all the included roles to access the corresponding URL or method
-
/login.jsp=anon
/css/**=anon
/js/**=anon
/images/**=anon
/validatecode.jsp=anon
/useraction_login.action=anon
/pages/base/standard.jsp = perms["Stanardard_page"]
/courieraction_deltebatch.action = perms["Courier_delete"]
/courieraction_update.action = perms["Courier_update"]
/courieraction_save.action = perms["Courier_save"]
/courieraction_page.action = perms["Courier_page"]
/**=authc
</value>
</property>
</bean>


<!--intercept authorizations using annotations, force cglib proxies, use Shiro annotations at the service layer --
<bean class= "Org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" >
<property name= "Proxytargetclass" value= "true" ></property>
</bean>
<!--Configure Shiro--
<bean class= "Org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor" ></bean >

</beans>

SSH Integration Applicationcontext.xml configuration file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.