MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » Struts+Hibernate+Spring 配置有关问题

Struts+Hibernate+Spring 配置有关问题

www.MyException.Cn  网友分享于:2013-12-27  浏览:17次
Struts+Hibernate+Spring 配置问题
新公司要求写一个Struts+Hibernate+Spring的例子,小弟搞了半天还是有问题,求助大家帮忙解决,问题如下:
环境:JDK1.5+Eclipse3.2+MyEclipse5.0+Tomcat5.5+SQL   2000
struts-config.xml内容:
<?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= "userRegisterForm "   type= "test.struts.user.form.UserRegisterForm "   />

    </form-beans>

    <global-exceptions   />
    <global-forwards   />
    <action-mappings   >
        <action
            attribute= "userRegisterForm "
            input= "/userRegister.jsp "
            name= "userRegisterForm "
            path= "/userRegister "
            scope= "request "
            type= "org.springframework.web.struts.DelegatingActionProxy ">
            <forward   name= "success "   path= "/success.jsp "   />
            <forward   name= "fail "   path= "/fail.jsp "   />
        </action>

    </action-mappings>

    <message-resources   parameter= "test.struts.ApplicationResources "   />
    <plug-in   className= "org.springframework.web.struts.ContextLoaderPlugIn ">
    <set-property   property= "contextConfigLocation "   value= "/WEB-INF/classes/applicationContext.xml "/>
    </plug-in>
</struts-config>

applicationContext.xml内容:
<?xml   version= "1.0 "   encoding= "UTF-8 "?>
<!DOCTYPE   beans   PUBLIC   "-//SPRING//DTD   BEAN//EN "   "http://www.springframework.org/dtd/spring-beans.dtd ">

<beans>
<bean   id= "dataSource "
class= "org.apache.commons.dbcp.BasicDataSource ">
<property   name= "driverClassName ">
<value> com.microsoft.jdbc.sqlserver.SQLServerDriver </value>
</property>
<property   name= "url ">
<value> jdbc:microsoft:sqlserver://localhost:1433 </value>
</property>
<property   name= "username ">
<value> test </value>
</property>
<property   name= "password ">
<value> test </value>
</property>
</bean>
<bean   id= "sessionFactory "
class= "org.springframework.orm.hibernate3.LocalSessionFactoryBean ">
<property   name= "configLocation ">
<value> classpath:hibernate.cfg.xml </value>
</property>
<property   name= "dataSource ">

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有