此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【aidaping】截止到2008-07-08 14:11:02的历史汇总数据(不包括此帖):
发帖的总数量:1                        发帖的总分数:20                       每贴平均分数:20                       
回帖的总数量:1                        得分贴总数量:0                        回帖的得分率:0%                       
结贴的总数量:0                        结贴的总分数:0                        
无满意结贴数:0                        无满意结贴分:0                        
未结的帖子数:1                        未结的总分数:20                       
结贴的百分比:0.00  %               结分的百分比:0.00  %                  
无满意结贴率:---------------------无满意结分率:---------------------
如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html

解决方案 »

  1.   

    spring+struts+hibernate的开发,需要掌握structs的mvc框架,spring的Business Logic处理。还有
    hibernate的orm框架。其实你如果对这3个有基本了解,那么学习起来还是很快的。
      

  2.   

    以下是针对myeclipse的ide的1.先建立连接,开发阶段用的jdbc连接,开发完毕后,换成数据库连接池,使用c3p0,proxool,不要用dbcp了,hibernate3.0对它已经不是很兼容了。2.先添加hibernate包,不要hibernate自己生成的sessionFactory,在spring的applicationContext.xm中添加会更加方便,生成映射类,不需要它生成的dao,自己手动写database's crud 的dao接口。3.添加spring的包,不用在添加spring的时候生成sessionFactory,在applicationContext.xm中添加dataSource数据源,在添加sessionFactory,到此可以删除,你的Hibernate.cfg.xml了,然后就是编写你的业务层和服务层了,因为spring是依赖注射的,在dao的目录下编写对database的crud的接口,在dao.hibernate的目录下去实现在dao的目录的接口,在service目录中编写对database的crud的接口,在service.impl中编写在service目录的接口,服务层的类并不直接操作数据库,而是通过调用到层去操作,然后在applicationContext中添加bean的形式把你编写的接口和类添加进来。4,添加struts的包,在web层中去调用服务层操作数据库,在struts-config.xml中设置action类用spring来代理,这需要在struts-config.xml中添加插件,<plug-in
              className="org.springframework.web.struts.ContextLoaderPlugIn">
              <set-property property="ContextConfigLocation"
              value="/WEB-INF/action-servlet.xml" />
     </plug-in>并且将Action改为type="org.springframework.web.struts.DelegatingActionProxy",在WEB-INF下建立一个spring的配置文件:action-servlet.xml,它的遵循的是<?xml version="1.0" encoding="UTF-8"?>
    <beans
     xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"></beans>如果用到struts的表单验证,还需在struts-config.xml文件里添加一个插件 <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
      <set-property property="pathnames"
       value="/org/apache/struts/validator/validator-rules.xml,/WEB-INF/validations.xml" />
     </plug-in>并且在WEB-INF下新建validations.xml文件格式如下:<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE form-validation PUBLIC
              "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.3.0//EN"
              "http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd">
    <form-validation> <global>
      <constant>
       <constant-name>phone</constant-name>
       <constant-value>^\d{8}\d*$</constant-value>
      </constant> </global>
     <formset>
      <form name="systemUserForm">
       <field property="userName" depends="required">
        <msg name="required"
         key="systemUSer.addSystemUser.userName" />
       </field>
       <field property="userPwd" depends="required">
        <msg name="required"
         key="systemUSer.addSystemUser.userPwd" />
       </field>
       <field property="userPwdChk" depends="required">
        <msg name="required"
         key="systemUSer.addSystemUser.userPwdChk" />
       </field>
       <field property="userPhone"
        depends="required,mask">
        <msg name="required" key="systemUSer.addSystemUser.userPhone" />
        <msg name="mask" key="errors.phone"  />
        <arg name="mask" key="systemUSer.addSystemUser.display.length" position="1"/>    
        <arg name="required" key="systemUSer.addSystemUser.display.userPhone" position="0"/>
        <arg name="mask" key="systemUSer.addSystemUser.display.userPhone" position="0"/>
        <var>
         <var-name>mask</var-name>
         <var-value>${phone}</var-value>
        </var>   </field>
       <field property="userEmail" depends="required,email">
        <msg name="required"
         key="systemUSer.addSystemUser.userEmail" />
         <msg name="email" key="errors.email"/>
        <arg name="email" key="systemUSer.addSystemUser.display.userEmail" position="0"/>
       </field>
      </form>
      <form name="loginForm">
       <field property="userName" depends="required">
        <msg name="required" key="systemUSer.login.userName" />
       </field>
       <field property="userPwd" depends="required">
        <msg name="required" key="systemUSer.login.userPwd" />
       </field>  </form>
      <form name="incomeExpTypeForm">
       <field property="incExpTyp" depends="required">
        <msg name="required"
         key="systemUSer.incomeExpensesType.incExpTyp" />
       </field>  </form>
      <form name="incomeExpensesForm">
       <field property="incExpTypId" depends="required">
        <msg name="required" key="IncomeExpenses.incExpTypId" />
       </field>
       <field property="incExpDesc" depends="required">
        <msg name="required" key="IncomeExpenses.incExpDesc" />
       </field>   <field property="incExpMn" depends="required,double">
        <msg name="required" key="IncomeExpenses.incExpMn" />
       </field>
      </form>
     </formset></form-validation>好了整合完毕了,但是还有运行还有问题,因为还缺少一些包apache的commons-pool-1.3.jar,Spring 2.0 Web Libraries包,还有spring和Hibernate的asm包冲突,我的做法是删除Hibernate包中的asm.jar,asm-attrs.jar。5.在web.xml中添加spring自带的监听器,主要目的是让application知道spring的存在,格式如下:<listener>
      <listener-class>
       org.springframework.web.context.ContextLoaderListener
      </listener-class>
     </listener>
     <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/applicationContext.xml</param-value>
     </context-param>如果项目大,表多的话,我建议spring的配置文件可以分为好几个,可以在dao层,service层,web层分开建立那样的话spring的配置文件会更加清晰,applicationContext_XXX.xml只要在web.xml中添加参数就可以了。6.在web.xml中添加spring自带的字符过滤器,省的自己再去写一个了,格式如下:<filter>
      <filter-name>encodingFilter</filter-name>
      <filter-class>
       org.springframework.web.filter.CharacterEncodingFilter
      </filter-class>
      <init-param>
       <param-name>encoding</param-name>
       <param-value>UTF-8</param-value>
      </init-param>
      <init-param>
       <param-name>forceEncoding</param-name>
       <param-value>true</param-value>
      </init-param>
     </filter> <filter-mapping>
      <filter-name>encodingFilter</filter-name>
      <url-pattern>/*</url-pattern>
     </filter-mapping>
    希望对你有帮助
      

  3.   

    推荐你去看一个基于equinox框架的ssh应用。
    在csdn上可以下载pdf文档:Spring基础教程.pdf(575k)