求struts spring ibatis 整合后的Demo 如果你从官网上下载的ibatis 那里面有demo,lz可以看看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我有一个例子,但是加上jar包就比较大了,用QQ给你传过去吧,我QQ:136452993 一个配置片段web.xml配置<?xml version="1.0" encoding="UTF-8"?><web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <filter> <filter-name>struts-cleanup</filter-name> <filter-class> org.apache.struts2.dispatcher.ActionContextCleanUp </filter-class> </filter> <filter-mapping> <filter-name>struts-cleanup</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:applicationContext.xml,classpath:applicationContext-extend.xml </param-value> </context-param> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list></web-app>struts.properties1 struts.objectFactory=spring2 struts.objectFactory.spring.autoWire=autoapplicationContext.xml01 <!-- 配置ibatis -->02 <bean id="sqlMapClient"03 class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">04 <property name="configLocation">05 <value>classpath:SqlMapConfig.xml</value>06 </property>07 <property name="dataSource">08 <ref bean="dataSource" />09 </property>10 </bean>1 <!-- 配置DAO -->2 <bean id="AdminDAO" class="cn.edu.hit.mis.dao.AdminDAOImpl">3 <property name="sqlMapClient">4 <ref bean="sqlMapClient" />5 </property>6 </bean>其他地方都一样 求解决异常 请问学J2EE应从什么地方开始学? Hibernate 多对多映射问题,跪求? rmi+hibernate hibernate插件 JAVA高级群5606401,加者有分, Struts中配置application.properties文件,如果有中文,显示出来的是乱码,你们是怎么解决的呢??!! 我的问题还是没有答案???? james好象不能接收外面服务器转发过来的邮件?可以自己编码增加这个功能吗?可否给点提示? 我这个在mysql中,不是在linux中 spring的配置文件真烦琐啊 在bat中运行hibernate应用,请各位同仁帮忙
web.xml配置
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:applicationContext.xml,classpath:applicationContext-extend.xml
</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>struts.properties
1 struts.objectFactory=spring
2 struts.objectFactory.spring.autoWire=autoapplicationContext.xml01 <!-- 配置ibatis -->
02 <bean id="sqlMapClient"
03 class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
04 <property name="configLocation">
05 <value>classpath:SqlMapConfig.xml</value>
06 </property>
07 <property name="dataSource">
08 <ref bean="dataSource" />
09 </property>
10 </bean>
1 <!-- 配置DAO -->
2 <bean id="AdminDAO" class="cn.edu.hit.mis.dao.AdminDAOImpl">
3 <property name="sqlMapClient">
4 <ref bean="sqlMapClient" />
5 </property>
6 </bean>
其他地方都一样