关于SSH的配置问题

来源:互联网 发布:怎么删除mac上的软件 编辑:程序博客网 时间:2024/06/08 00:35

1.配置监听器( web.xml)

< listener>
   <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <context-param>
   <param-name>contextConfigLocation</param-name>
   <param-value>自己spring的xml路径</param-value>
  </context-param>

2.struts +srping +hibernate的结合

在struts-config中的Action中把type属性的值指向spring的DelegatingActionProxy类

eg:

  <action
      attribute="loginForm"
      input="/login.jsp"
      name="loginForm"
      path="/login"
      scope="request"
      type="org.springframework.web.struts.DelegatingActionProxy">

在spring中注入strut和hibernate

  <bean name="/login" class="com.der.struts.action.LoginAction">
       <property name="user">
         <ref bean="UserDAO"/>
       </property>

原创粉丝点击