zoukankan      html  css  js  c++  java
  • 第五课 Struts的控制器【续】Action类的execute()方法

    1.Action类的execute()方法:
    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等。


  • 相关阅读:
    sublime 部分插件
    Error: EACCES: permission denied, mkdir '......node-sass/build'错误解决方案
    字符串
    数组
    MySQL5.7.26 忘记Root密码小计
    CentOS7安装MySQL8.0小计
    代替print输出的PY调试库:PySnooper
    聊聊数据库~5.SQL运维上篇
    'gbk' codec can't encode character 'xa0' in position 34: illegal multibyte sequence
    稍微记录下Django2.2使用MariaDB和MySQL遇到的坑
  • 原文地址:https://www.cnblogs.com/jzssuanfa/p/6848475.html
Copyright © 2011-2022 走看看