struts框架

struts

包结构及说明

包结构

  • src
    -在这里插入图片描述

src包**意点

  • action包为控制层,相当于controller
    1.需要继承 DispatchActionSupport
    2.声明注解 在这里插入图片描述
    3.需要在action-servlet.xml文件中配置(如下图)
    在这里插入图片描述
    4.运行ant工具下build.xml文件,该操作会在struts-config.xml下生成映射

  • dao层为数据库访问层
    实现类需要继承MyDaoSupport

  • domain相当于实体类层

  • service为业务层

    • service和dao需要在AppContext.xml中配置(如下图)
      在这里插入图片描述