作者:吴燕凤怡雨家琴 | 来源:互联网 | 2023-06-04 07:33
在webService中需要用spring容器中的资源来实现功能,如需要获取数据库连接applicationContext.xml配置文件:<beansxmlns"http:w
在webService中需要用spring容器中的资源来实现功能,如需要获取数据库连接
applicationContext.xml配置文件:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:cOntext="http://www.springframework.org/schema/context"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd">
............................
这样在Impl,java文件中可以直接定义SessionFactory 类型和使用setSessionFactory 方法了。
关于下面的配置:
暂时先用这一种,以后用时间在试试其他的配置方式。