struts1与struts2
来源:互联网 发布:淘宝删除中差评步骤 编辑:程序博客网 时间:2024/05/22 10:26
Struts1
web.xml配置
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/app*.xml</param-value>
</context-param>
<filter>
<filter-name>ChineseFilter</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>
</filter>
<filter>
<filter-name>OpenSession</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>ChineseFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>OpenSession</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<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>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</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>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
struts配置
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
<form-beans >
<form-bean name="empForm" type="com.web.struts.form.EmpForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="empForm"
input="regiist.jsp"
name="empForm"
parameter="method"
path="/emp"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy" />
</action-mappings>
<message-resources parameter="com.web.struts.ApplicationResources" />
</struts-config>
Struts2
web.xml配置
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:beans.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<filter>
<filter-name>Struts2</filter-name>
<!-- <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>-->
<filter-class>com.kairgus.common.FCKFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
struts.xml配置
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<constant name="struts.i18n.encoding" value="GB18030" />
<package name="default" namespace="/" extends="struts-default">
<default-action-ref name="index" />
<global-results>
<result name="error">/error.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="error"/>
</global-exception-mappings>
<action name="emp_*" class="com.action.EmpAction" method="{1}">
<result name="input">error.jsp</result>
<result name="success">/insertAdmin/enterprise_info.jsp</result>
</action>
</package>
<!-- Add packages here -->
</struts>
- Struts2 与 Struts1区别
- struts1 与 struts2 比较
- Struts2与Struts1.X
- struts1与struts2比较
- struts2与struts1
- struts1与struts2区别
- struts1与struts2流程图
- struts1与struts2区别
- Struts1与Struts2原理
- struts1与struts2比较
- Struts1与Struts2区别
- struts1与struts2
- struts1与struts2
- Struts1与Struts2
- Struts2与Struts1的对比
- Struts2与Struts1的对比
- Struts2与Struts1的对比
- Struts2与Struts1的对比
- jquery $(document).ready() 与window.onload的区别以及DOMContentLoaded事件
- 文件的对称加密与解密
- 黑马程序员_IO流
- 用python 写一个nagios插件 监控http内容
- 在 Spring 3.1 中使用 @Cacheable 实现缓存
- struts1与struts2
- 特征提取-计算tf-idf
- Eclipse 快捷键
- 搭建MinGW+Msys+Git环境
- window 下,为Python 安装protobuf
- ECMA闭包、块级作用域
- 领导力来自天赋?还是学习?
- To be a Amazoner - 需要潜修的技能(mark以自勉)
- WriteFile操作时返回87错误