码迷,mamicode.com
首页 > 编程语言 > 详细

hibernate3 spring3 struts1

时间:2016-05-15 19:56:14      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:hibernate3 spring3 struts1

公司近期要上OA项目,SB供应商用的hibernate spring struts1搭建的框架,然后在这三个框架基础上扩展了自己的技术,SB供应商的开发是个老油条,拽得跟个二五八万一般,不管问什么,都爱理不理的,只能自己搭一套简易的框架练练手。

web.xml文件


<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://Java.sun.com/xml/ns/j2ee" xmlns:javaee="http://xmlns.jcp.org/xml/ns/javaee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="starter" version="2.4">

  <display-name>user management</display-name>

  <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>

  <listener>

    <listener-class>org.springframework.web.util.Log4jConfigListener

</listener-class>

  </listener>

  <context-param>

    <param-name>log4jConfigLocation</param-name>

    <param-value>classpath:config/log4j.properties</param-value>

  </context-param>


  <filter>

    <filter-name>characterEncoding</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>characterEncoding</filter-name>

    <url-pattern>/*</url-pattern>

  </filter-mapping>

  <servlet>

    <servlet-name>action</servlet-name>

    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

    <init-param>

      <param-name>config</param-name>

      <param-value>/WEB-INF/struts-config.xml</param-value>

    </init-param>

    <load-on-startup>0</load-on-startup>

  </servlet>

  <servlet-mapping>

    <servlet-name>action</servlet-name>

    <url-pattern>*.do</url-pattern>

  </servlet-mapping>

  <session-config>

    <session-timeout>30</session-timeout>

  </session-config>

  <welcome-file-list>

    <welcome-file>/index.jsp</welcome-file>

  </welcome-file-list>

</web-app>



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>

<form-beans>

<form-bean name="loginForm" type="com.nubia.ss1h.pojo.LoginForm">

<form-property name="user" type="com.nubia.ss1h.pojo.User"></form-property>

</form-bean>

</form-beans>


<action-mappings>

<action path="/login" type="com.nubia.ss1h.action.LoginAction" name="loginForm">

<forward name="loginSuccess" path="/loginSuccess.jsp"></forward>

<forward name="loginFailure" path="/loginFailure.jsp"></forward>

</action>

</action-mappings>

<controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor"/>

</struts-config>


技术分享

技术分享

技术分享

和struts2不一样的是,你得配置在apllication.xml文件中配置action。



hibernate3 spring3 struts1

标签:hibernate3 spring3 struts1

原文地址:http://isiah.blog.51cto.com/6545858/1773637

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!