第五课 Struts的控制器【续】Action类的execute()方法
2017-05-13 11:29
351 查看
1.Action类的execute()方法:
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException ;
2.Action类的execute()方法的參数和返回值:
– execute()方法包括下面參数:
–ActionMapping:包括了这个Action的配置信息,和strutsconfig.xml文件里的<action>元素相应。
–ActionForm:包括了用户的表单数据。当Struts框架调用
execute()方法时,ActionForm中的数据已经通过了表单验证。
–HttpServletRequest:当前的HTTP请求对象
–HttpServletResponse:当前的HTTP响应对象
–Action类的execute()方法返回ActionForward对象。它包括了请求转发路径信息。
3.内置的Struts Action类:
–org.apache.struts.actions.ForwardAction
–org.apache.struts.actions.IncludeAction
–org.apache.struts.actions.DispatchAction
–org.apache.struts.actions.LookupDispatchAction
–org.apache.struts.actions.SwitchAction。
4.模型代表应用的业务数据和业务逻辑。Struts作为一个WEB框架并没有为创建模型组件提供现成的
框架。
可是Struts同意使用其他模型框架来处理应用的业务逻辑。比方:EJB、JDO、JavaBean、
ORM、Spring等。
相关文章推荐
- 第五课 Struts的控制器【续】Action类的execute()方法
- struts2框架中Action必须实现execute方法?和Struts参数传递
- struts中拦截器拦截Action中的execute方法后的具体拦截流程
- 如何在struts中的action的execute方法()中弹出对话框
- struts学习笔记--解决了struts action中的execute方法不执行的问题
- 解决:Cannot find message resources under key org.apache.struts.action.MESSAGE的 方法
- struts表单中多个submit的处理方法:org.apache.struts.actions.DispatchAction
- struts表单中多个submit的处理方法:org.apache.struts.actions.LookupDispatchAction
- Struts action 多个方法
- Action.perform in struts1.0 & Action.execute in struts1.1
- 在Struts action中利用.do跳转到另一action传值方法
- struts ,action,跳转变化页面方法
- struts的ui标签,theme(主题)(如何去掉fielderror actionerror actionmessage前的小点,让其按自己要求显示的5种方法)
- struts为每个独立请求创建一个Action的方法
- Struts配置之action属性set-property的配置方法
- struts中actionFrom传递日期出错的解决方法
- 在使用struts的DispatchAction的时候出现Action找不到指定方法的错误
- StrutsAction中传入的form对象为空的解决方法
- Struts 2 Action 的扩展名修改方法
- struts中action的通过传过来的参数判断跳转的两种方法