请教ssh框架搭建时的一个问题 struts整合spring的配置 按照你这个配置应该是通过struts-config.xml中的spring plugin来整合的将action的AuthDAO去掉可以运行吗?com.yourcompany.struts.action.LoginAction里有setDao方法吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是用plugin整合的 把AuthDAO去掉还有sessionfactory也注掉,单独注入person属性就是可以的 也有set方法怀疑是hibernate影响的,但是不通过action,直接测试AuthDAO Bean 可以访问到数据库,很奇怪?! <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config> <data-sources /> <form-beans > <form-bean name="loginForm" type="com.yourcompany.struts.form.LoginForm" /> </form-beans> <global-exceptions /> <global-forwards /> <!-- <action-mappings > <action attribute="loginForm" input="/form/login.jsp" name="loginForm" path="/login" scope="request" type="com.yourcompany.struts.action.LoginAction"> <forward name="success" path="/form/success.jsp" /> </action> </action-mappings> --> <action-mappings > <action attribute="loginForm" input="/form/login.jsp" name="loginForm" path="/login" scope="request" type="org.springframework.web.struts.DelegatingActionProxy"> <forward name="success" path="/form/success.jsp" /> </action> </action-mappings> <message-resources parameter="com.yourcompany.struts.ApplicationResources" /> <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"> <set-property property="contextConfigLocation" value="/WEB-INF/classes/applicationContext.xml" /> </plug-in></struts-config> <value>file:src/hibernate.cfg.xml</value>改为<value>classpath:hibernate.cfg.xml</value>试试 可以了,谢啊!!!是不是因为两种分别对应于spring的ClassPathXmlApplicationContext和FileSystemXmlApplicationContext,我在测试的时候用后者也不行,提示在/bin/下找不到applicationContext,只是没想到要改这里,可为什么file的就不行? 两个表怎么同时插入数据 weblogic问题。 Java sax xml 解析问题 hiberater不使用hiberate.cfg.xml配置 关于文件格式的转换和内容排版问题 英国公司急招JAVA的人,提供去英国培训!!! 很大的问题!我是新手! 公司让我买书,希望推荐基本经典的 struts中 jsp页面编译时,以什么方式编码? 新手求教!! 怎么我安装TSVN中文包后,还是找不到中文语言切换的啊? struts1中跳转页面的问题?
怀疑是hibernate影响的,但是不通过action,直接测试AuthDAO Bean 可以访问到数据库,很奇怪?!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config>
<data-sources />
<form-beans >
<form-bean name="loginForm" type="com.yourcompany.struts.form.LoginForm" /> </form-beans> <global-exceptions />
<global-forwards />
<!--
<action-mappings >
<action
attribute="loginForm"
input="/form/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.yourcompany.struts.action.LoginAction">
<forward name="success" path="/form/success.jsp" />
</action> </action-mappings>
-->
<action-mappings >
<action
attribute="loginForm"
input="/form/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="success" path="/form/success.jsp" />
</action> </action-mappings> <message-resources parameter="com.yourcompany.struts.ApplicationResources" />
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/classes/applicationContext.xml" />
</plug-in>
</struts-config>
改为<value>classpath:hibernate.cfg.xml</value>试试
,只是没想到要改这里,可为什么file的就不行?