1、struts2名词解释
Struts2 是 Apache推出的一个的 Java Web 开源框架,本质上相当于一个 servlet,是在 Struts1 和 WebWork 基础上开发的
2、struts.xml中配置的标签、属性及其描述
- package namespace(命名空间) name(名称) extend=“struts-default”(继承默认xml)
- action name(地址栏中信息) class(指向Action类) method(Action类中的方法)
- result name(与Action类的method方法的返回值对应) type(跳转的类型)
3、struts2搭建步骤
- pom.xml中引入struts-core包
- web.xml中配置过滤器 类是StrutsPrepareAndExecteFilter url-pattern是*.action
- 写Action类 和具体的方法
- 在resource包中加入struts.xml 并引入表头
- 写jsp页面
4、struts.xml中result的type取值有哪些
- dispatcher 请求转发
- redirect 重定向页面
- redirectAction 重定向到一个action
- chain :用来处理Action链