struts2基础
来源:互联网 发布:服务器怎么开放端口 编辑:程序博客网 时间:2024/05/21 06:38
struts2大的设计模式还是MVC
struts2控制器由两部分组成
-FilterDispatcher
-业务逻辑Action
struts2目录结构
APPs:示例程序
docs:文档
lib:jar包
src:源代码
result类型:
redirect:地址栏显示全路径(重定向)
plaintext:显示的为html文本样式
dispatcher:地址栏显示的为Action路径样式(请求转发:带参数跳转)
constant:
<constant>:在struts.xml中定义一个常量
packge:
<packge name="example" namespace="/" extends="struts-default">
example:另一个包想调用本包,通过名称引用
namespace:命令空间; /:默认的根命名空间(通过命名空间区分同一项目下的相同路劲:action名称) /abc:在页面上要写/abc/login.jsp())
struts-
<packge name="example" namespace="/" extends="struts-default" abstract="true">
abstract="true":是一个抽象包,抽象包里面不能有action定义
包含配置:
<include file="*.xml">:体现了分而治之的思想
Action:3种方法进行页面跳转
struts2类型转换
struts2的类型转换是基于OGNL(对象图形导航语言)的,
在OGNL中有一个接口TypeConverter(类型转换器),该接口中有一个方法
convertValue.
拦截器的设计思想是当前比较流行的AOP面向方面编程的思想应用,
其实现模式是代理模式和反射机制
代理模式分类:
1.动态代理
2.静态代理
struts2控制器由两部分组成
-FilterDispatcher
-业务逻辑Action
struts2目录结构
APPs:示例程序
docs:文档
lib:jar包
src:源代码
result类型:
redirect:地址栏显示全路径(重定向)
plaintext:显示的为html文本样式
dispatcher:地址栏显示的为Action路径样式(请求转发:带参数跳转)
constant:
<constant>:在struts.xml中定义一个常量
packge:
<packge name="example" namespace="/" extends="struts-default">
example:另一个包想调用本包,通过名称引用
namespace:命令空间; /:默认的根命名空间(通过命名空间区分同一项目下的相同路劲:action名称) /abc:在页面上要写/abc/login.jsp())
struts-
<packge name="example" namespace="/" extends="struts-default" abstract="true">
abstract="true":是一个抽象包,抽象包里面不能有action定义
包含配置:
<include file="*.xml">:体现了分而治之的思想
Action:3种方法进行页面跳转
struts2类型转换
struts2的类型转换是基于OGNL(对象图形导航语言)的,
在OGNL中有一个接口TypeConverter(类型转换器),该接口中有一个方法
convertValue.
拦截器的设计思想是当前比较流行的AOP面向方面编程的思想应用,
其实现模式是代理模式和反射机制
代理模式分类:
1.动态代理
2.静态代理
0 0
- struts2基础
- Struts2基础
- struts2基础
- struts2基础
- Struts2 基础
- struts2基础
- struts2基础
- Struts2基础
- Struts2基础
- Struts2基础
- struts2--基础
- Struts2基础
- struts2基础
- Struts2基础
- Struts2基础
- Struts2基础
- Struts2 基础
- Struts2基础
- HTML中让表单input等文本框为只读不可编辑的方法
- 《Effective C++》42: 了解 typename 的双重意义
- Objective-C Runtime 一小时入门教程(上)
- poj1502 MPI Maelstrom(dijkstra模板)个人理解
- Android的DisplayUtil
- struts2基础
- uva11054 - Wine trading in Gergovia
- 接口和抽象类的区别
- 股票文章笔记
- 对象(DuoTaiDemo2)
- 红黑树
- poj 1436
- GDKOI2016 Day2 T1 染色大战
- 不可不知的GitHub功能