Structs2下的MyFirstTest
1.这是《Struts2-权威指南》第二章的例子
2.博文主要说明在eclipse下如何创建一个struts2项目
<web-app 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" version="3.0">
<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>/*</url-pattern>
</filter-mapping>
</web-app>

<!-- 指定Struts 2配置文件的DTD信息 -->
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<!-- struts是Struts 2配置文件的根元素 -->
<struts>
<!-- Struts 2的Action必须放在指定的包空间下定义 -->
</struts>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title><s:text name="登录页面"/></title>
</head>
<body>
<s:form action="Login">
<s:textfield name="username" label="用户名" />
<s:textfield name="password" label="密码" />
<s:submit value="登录"/>
</s:form>
</body>
</html>
<html>
<head>
<title>成功页面</title>
</head>
<body>
${sessionScope.user},登陆成功!
</body>
</html>
<html>
<head>
<title>失败页面</title>
</head>
<body>
登陆失败!
</body>
</html>
<!-- 指定Struts 2配置文件的DTD信息 -->
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<!-- struts是Struts 2配置文件的根元素 -->
<struts>
<!-- Struts 2的Action必须放在指定的包空间下定义 -->
<package name="myFirstTest" extends="struts-default">
<action name="Login" class="lee.LoginAction">
<result name="success">/welcome.jsp</result>
<result name="error">/error.jsp</result>
</action>
</package>
</struts>
Structs2下的MyFirstTest的更多相关文章
- 初学structs2,简单配置
一.structs2-demo1项目下新建structs.xml文件,文件名必须是structs 二.package节点配置及其子节点配置 <!--name:单纯给包起个名字,保证和其他包不重名 ...
- C++程序结构---1
C++ 基础教程Beta 版 原作:Juan Soulié 翻译:Jing Xu (aqua) 英文原版 本教程根据Juan Soulie的英文版C++教程翻译并改编. 本版为最新校对版,尚未定稿.如 ...
- 初学structs2,表单验证
一.简单表单验证示例 structs.xml配置 <struts> <package name="validate" namespace="/valid ...
- 搭建 structs2 环境
前言 环境: window 10 ,JDK 1.8 ,Tomcat 7 ,MyEclipse 2014 pro 搭建 SSH 环境的步骤 创建 JavaWeb 项目 导入 structs2 的jar包 ...
- 十四、MVC的WEB框架(Structs2)
一.Structs2中的Session 1.一个是传统的servlet包下的HttpSession,一个是Structs2中自己定义的Session Servlet下的Session获取方法:Serv ...
- 十三、MVC的WEB框架(Structs2)
一.Structs2的应用 Structs2是基于MVC的WEB框架.一般基于框架的程序要运行成功,对于JAR包的版本,配置文件的正确性有着苛刻的要求,一个地方错了,都会导致框架程序运行出错. 1.首 ...
- Structs2笔记③--局部类型转换案例
Structs2的类型转换-局部类型转换 Ognl强大的表达式语言,在导入项目的时候我们导入了ognl.jar包,内有TypeConverter类,struct主要依赖于他进行类型转换. 例子 i ...
- Code First 下自动更新数据库结构(Automatic Migrations)
示例 Web.config <?xml version="1.0" encoding="utf-8"?> <configuration> ...
- Android SwipeRefreshLayout 下拉刷新——Hi_博客 Android App 开发笔记
以前写下拉刷新 感觉好费劲,要判断ListView是否滚到顶部,还要加载头布局,还要控制 头布局的状态,等等一大堆.感觉麻烦死了.今天学习了SwipeRefreshLayout 的用法,来分享一下,有 ...
随机推荐
- java总结1
栈,堆,方法区.main和局部变量在栈,new 对象 在堆, 类和常量在方法区除了8大基础数据类型,其他都为引用变量局部变量在函数内或方法上声明,没有默认值,定义必须赋值一旦提供构造方法,就不会有默认 ...
- CDOJ 1069 秋实大哥去打工 单调栈 下标处理
E - 秋实大哥去打工 Time Limit:1000MS Memory Limit:65535KB 64bit IO Format:%lld & %llu Submit St ...
- 2019 Multi-University Training Contest 3 T7 Find the answer
Find the answer Time Limit: 4000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Tota ...
- cvtColor
E:/OpenCV/opencv/sources/modules/imgproc/src/color.cpp CV_RGB2GRAY:RGB--->GRAY.
- ModelSerializer 使用知识点_序列化和反序列化用法区别
1.ModelSerializer 如下 from api_test.errorCode.errorCode import Statusclass RelatedbSerializer(serial ...
- jconsole性能监控
1.进入tomcat bin目录 vim catalina.sh #!/bin/sh下面加入: #!/bin/shJAVA_OPTS="-Dcom.sun.management.jmxrem ...
- 自定义input上传图片组件
自定义input上传图片组件,美化样式 前段时间因为项目需求,做过一个上传图片组件,这里分享下大致思路,希望对有需要的童鞋有所帮助~~~ 功能需求:1.上传图片限制大小.分辨率.类型 2.上传图片支持 ...
- 20182335实验一《Linux基础与Java开发环境》
课程:<程序设计与数据结构> 班级: 1823 姓名: 李金泉 学号:20182335 实验教师:王志强 实验日期:2019年9月9日 必修/选修: 必修 1.实验内容 基于命令行和IDE ...
- mysql update语句与limit的结合使用
有时候有需要批量更新数据表中从多少行到多少行的某个字段的值 mysql的update语句只支持更新前多少行,不支持从某行到另一行,比如 UPDATE tb_name SET column_name=' ...
- 使用C#检测电脑上是否安装某软件
private void button2_Click(object sender, EventArgs e) { try { string app = "chrome.exe"; ...