struts

包结构及说明

struts框架

  • src
    -struts框架

src包**意点

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

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

  • domain相当于实体类层

  • service为业务层

    • service和dao需要在AppContext.xml中配置(如下图)
      struts框架

相关文章: