struts入门

struts入门
1、jar导入
2、web.xml strutsprepareandexecutefilter
3、struts.xml
struts-default.xml(struts-core.jar)
struts-base.xml(开发基本配置,package)xxxaction_*
struts-sy.xml
4、action execute //struts 默认跳转action里的execute方法
5、struts-sy.xml配置
6、jsp调用
struts动态调用
name=xxxaction_* method={1}
<action name="calAction_*" class="com.zking.web.CalAction" method="{1}"> <result name="seccess">/seccess.jsp</result> </action>
7
相互传值
1、modeldriven               //实现ModelDriven的getModel
2、set、get方法使用
3、对象导航                    //&user2.uid=222&user2.uname=225
8
j2ee与struts上下文集成
注入
耦合 implement servletRequestAware
解耦
非注入
耦合 servletActionContext.getContext.getrequest
解耦

1、拿到request就可以想jsp页面传值
2、在action中定义属性,提供set、get方法,那么jsp页面也可以拿到值。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值