struts2基本的配置代码
2024-10-01 22:53:39
<?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.action.extension" value="do,,"></constant> <package name="default" namespace="/" extends="struts-default"> <!-- 只要编写了一个action类,就需要在这里配置 --> <!-- 下面的意思是: hello:请求地址,就是jsp跳转页面写的:hello.action
class:访问hello跳转执行的类,类的名称和请求跳转的页面没必要一定相同。
method:属性的方法去执行 如果没有设置的method的话,那么就执行名字是execute的方法,这个是默认值。
然后的话,class也是有默认值的,不过一般都不用
-->
<action name="hello" class="com.itheima.action.HelloAction" method="sayHello">
<!-- 配置跳转的页面
执行方法return的是什么字符串,这个name属性就写什么字符串,
-->
<result name="ok" type="">/demo1/suc.jsp</result>
</action>
</package>
<!-- 引入其他的配置文件,但是用到的概率不到,了解一下就ok -->
<include file="com/iteima/user/struts_user.xml"></include>
</struts>
最新文章
- [LeetCode] Insert Interval 插入区间
- iOS sqlite数据库图像化查看
- php读取html文件(或php文件)的方法
- keycode按键对照表
- python 行转列
- Kryo 为什么比 Hessian 快
- HDU-4628 Pieces 搜索 | DP
- C#开发-ftp操作方法整理
- 【html】【9】div布局[div层叠]
- c语言学习之基础知识点介绍(六):if和switch结构
- DB2JAVIT:RC=9505解决方案
- uva 105 - The Skyline Problem
- js戳和php戳时间换算
- Linux系统把/home重新挂载到其他硬盘或分区
- python中不能写n++
- I/O输入流基础之FileInputStream
- vue-awesome-swiper组件不能自动播放和导航器小圆点不显示问题
- React中父子组件间的通信问题
- C++ Primer Plus学习:第三章
- VC知识库
热门文章
- Cisco安全防护读书笔记之一Cisco系统设备协议漏洞
- GetListToJson
- 洛谷 P1194 买礼物
- [Javascirpt AST] Babel Plugin -- create new CallExpression
- 存储过程和SQL语句比较
- IOS系统不兼容position: fixed;属性的解决方案
- BingMap频繁Add Pushpin和Delete Pushpin会导致内存泄露
- hadoop组件及其作用
- 单位转换 inch mm mil
- Web自动化测试 Selenium+Eclipse+Junit+TestNG+Python