struts2 实现过程和xml配置
实现过程:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="user" namespace="/User" extends="struts-default">
<action name="Login">
<result>/login.jsp</result>
</action>
<action name="Welcome" class="com.yiibai.user.action.WelcomeUserAction">
<result name="SUCCESS">/welcome_user.jsp</result>
</action>
</package>
</struts>
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
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_3_0.xsd">
<display-name></display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping></web-app>
struts2 实现过程和xml配置的更多相关文章
- 【Struts2学习笔记(11)】对action的输入校验和XML配置方式实现对action的全部方法进行输入校验
在struts2中,我们能够实现对action的全部方法进行校验或者对action的指定方法进行校验. 对于输入校验struts2提供了两种实现方法: 1. 採用手工编写代码实现. 2. 基于XML配 ...
- Struts2 XML配置详解
struts官网下载地址:http://struts.apache.org/ 1. 深入Struts2的配置文件 本部分主要介绍struts.xml的常用配置. 1.1. 包配置: S ...
- struts2视频学习笔记 22-23(基于XML配置方式实现对action的所有方法及部分方法进行校验)
课时22 基于XML配置方式实现对action的所有方法进行校验 使用基于XML配置方式实现输入校验时,Action也需要继承ActionSupport,并且提供校验文件,校验文件和action类 ...
- Struts2笔记——struts.xml配置详解
访问HelloWorld应用的路径的设置 * 在struts1中,通过<action path=“/primer/helloWorldAction.action”>节点的path属性指定访 ...
- struts2 的struts.xml配置详解
在应用struts框架进行开发时,必不可少的一步就是对struts.xml进行配置,对于该文件了解越多,我们开发起一应用程序定会更加顺手.下面我们看一下struts.xml的内容,每一项都有什么作用. ...
- struts2拦截器-自定义拦截器,放行某些方法(web.xml配置)
一.web.xml配置 <filter> <filter-name>encodingFilter</filter-name> <filter-class> ...
- struts2.1.6教程二、struts.xml配置及例程
1.配置文件的优先级 在struts2中一些配置(比如常量)可以同时在struts-default.xml(只读性),strtus-plguin.xml(只读性),struts.xml,struts. ...
- Struts2第十篇【数据校验、代码方式、XML配置方式、错误信息返回样式】
回顾以前的数据校验 使用一个FormBean对象来封装着web端来过来的数据 维护一个Map集合保存着错误信息-对各个字段进行逻辑判断 //表单提交过来的数据全都是String类型的,birthday ...
- struts2 --xml配置
struts2.5 官方文档介绍 这个是struts2.5给出的web.xml配置方式,核心包已经被挪到了ng的上一层 <web-app id="MyStrutsApp" v ...
随机推荐
- java内部类实现多继承
class Example1 { public String name() { return "liutao"; } } class Example2 { public int a ...
- hdu 3460
算法:字典树 题意:给你一些单词,有一台打印机只能进行以下三种操作 1.读入 2.删除 3.打印 让你输出最少的操作次数将这些单词全部打印出来: (字典树节点-1)*2 表示读入和删除操作: 打印操 ...
- linuxmit下git安装和初级使用
一.安装 sudo apt-get install git 二.配置 git config --global user.name "Your Name" git config -- ...
- CSS的一些思考(一)
迈入前端行业已经8个多月了,从之前懵懵懂懂到现在的能根据设计图迅速成型页面,自我感觉良好.最近看到张大牛的一篇博客<说说CSS学习中的瓶颈>,突然意识到,自己不就处在快速学习和成长后的一个 ...
- python functools.wraps装饰器模块
# -*-coding=utf-8 -*-#实现一个函数执行后计算执行时间的功能 __author__ = 'piay' import time, functools def foo(): ''' 定 ...
- 开心菜鸟系列学习笔记--------初探Nodejs(了解篇)
一Node.js开始学习了! 1) 输出hellow worlds a.建一个js文件 hello.js 写 console.info('hellow world !!!'); 进入终 ...
- Codeforces 518D Ilya and Escalator
http://codeforces.com/problemset/problem/518/D 题意:n个人,每秒有p的概率进电梯,求t秒后电梯里人数的期望 考虑dp:f[i][j]代表第i秒有j个人的 ...
- format %x invalid or incompatible with argument问题解决方法
现在还有好多朋友在用Protel 99se来画图,可是在现在的双核或四核电脑上运行Protel出现错误并且弹出对话框:“format '%x' invalid or incompatible with ...
- Linux驱动开发相关
一般用printk 查看/etc/sysconf文件,看看内核调试信息放到了哪里 打印的消息一般放在/var/log/messages文件里面. 如果你是在X Windows下的XTerm中insmo ...
- C/C++ 指针的非空判断
一定要分得清楚C和C++的“空指针常量”不是一样的.C标准不保证NULL等于0,所以做指针非空判断时,应该用if(p != NULL):因为“上下文转换到bool值”的统一性,C++就应该用if(p) ...