ssh整合

来源:互联网 发布:mac用office办公软件 编辑:程序博客网 时间:2024/06/15 16:40
ssh整合困扰了me好几天,终于给弄好了!
大体步骤如下:
1,我是先整合spring和hibernate这俩个框架,这里就不再重复写了,之前已经写过了,地址
http://blog.csdn.net/shipeng22022/article/details/9149307
2,整合完后这俩个框架,接下来整合struts2,把struts2相关东西都建好了之后,重在配置文件
首先在struts.xml文件里<package ....>之前加入
  <constant name="struts.objectFactory" value="spring"/>        <!--把struts2里的action交给spring来控制-->
<constant name="struts.devMode" value="true"/>                <!--开发模式-->
3,在web,xml文件里进行配置
在里面加入
  <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/classes/beans.xml</param-value>        <!--你的spring配置文件地址-->
  </context-param>
  
  <listener>  
    <description>Spring core configuration</description>  
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>  
  </listener> 
  
4,到这里就配置完成了
原创粉丝点击