1、参数赋值的三种方式:
1-1) Action中定义属性,并提供get/set方法:
userName, getUserName/setUserName
1-2)实现ModelDriven 接口:
返回实体,不能为null,不需要提供get/set方法
1-3) ModelDriven返回实体和Action中属性重名,ModelDriven中优先级更高:
2、struts 与J2EE容器交互:
2-1 非注入
①耦合
ServletActionContext
②解耦(建立使用解耦模式)
ActionContext
2-2 注入
①耦合
②解耦
3、核心文件配置:
3.1 include 包含文件
file
3.2 package 包
name 包名
extends 继承
namespace 虚拟路径
abstract 通常用来被继承
3.3 action 子控制器
name:helloAction,helloAction_*
class 全限定名
method:execute,{1}
3.4 result
name
type:dispatcher|redirect
注1:动态方法调用,新版本中已禁用,可自行开启或关闭
注2:子控制器的访问路径:名称空间+"/"+子控制器名字_xxx+".action"
207

被折叠的 条评论
为什么被折叠?



