java-spring与mongodb的整合方式一 自动注入xml(6)
- UID
- 1066743
|
java-spring与mongodb的整合方式一 自动注入xml(6)
action相关配置:
action.xml
<?xml version="1.0" encoding="GBK"?>
<!-- 指定Spring配置文件的Schema信息 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- 配置DAO组件的模板 -->
<bean id="getData" class="com.mongo.action.getDataAction" >
<property name="userReposity" ref="userReposity"></property>
</bean>
</beans>
package.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
"http://struts.apache.org/dtds/struts-2.1.7.dtd">
<struts>
<package name="data" extends="zoe-default" namespace="/data">
<!-- 根据项目 -->
<action name="getData" class="getData">
<result type="json"></result>
</action>
</package>
</struts> |
|
|
|
|
|