1. 开发模式
    1. Model Ⅰ
      1. JSP + JDBC
    2. Model Ⅱ
      1. Servlet + JSP + JavaBean
    3. MVC
      1. 模型-Model
      2. 视图-View
      3. 控制器-Controller
  2. Struts2框架搭建
    1. 1.添加jar包
    2. 2.配置核心控制器
    3. 3.添加struts.xml
    4. 4.创建业务控制器
      1. 1.普通类-execute
      2. 2.实现接口-Action
      3. 3.继承父类-ActionSupport
  3. Struts2配置
    1. struts.xml的相关配置
    2. package包
      1. name
      2. namespace
      3. extends继承
        1. struts-default
        2. json-default
      4. include导入其他的struts_*.xml
    3. action
      1. name
      2. class
      3. method
        1. execute-默认
      4. result
        1. name
          1. login
          2. input
          3. success
          4. error
        2. type
          1. redirect
          2. redirectAction
          3. dispatcher-默认
          4. chain
          5. json
          6. stream
    4. constant-常量
      1. 也可以将常量配置到struts.properties
    5. global-results
    6. global-exception
    7. interceptors
  4. 其他
    1. servlet解耦
      1. ActionContext
      2. ServletActionContext
        1. getRequest()
          1. HttpServletRequest
        2. getSession()
          1. HttpServletSession
        3. getResponse()
        4. getApplication()
  5. ognl和struts2标签
    1. ognl
      1. 对象导航图语言
      2. 查询和显示数据的一种表达式语言
      3. 作用域
        1. ValueStack
          1. Action的实例
        2. StackContext
          1. ActionContext.put(key, value)
          2. #request
          3. #session
          4. #application
          5. #parameters
    2. struts2标签
      1. <%@ taglib uri="/struts-tags" prefix="s" %>
      2. 数据标签
        1. property
        2. date
        3. set
      3. 控制标签
        1. if
        2. elseif
        3. else
        4. iterator
      4. UI标签
        1. form
        2. textfield
        3. textarea
        4. submit
        5. select
        6. file
      5. ajax标签
    3. struts2验证框架
      1. 客户端验证
        1. 运行在客户端浏览器-javascript代码
        2. 用户体验好,但是不安全
      2. 服务器端验证
        1. 运行在服务器端-Java代码
        2. 验证的几种实现方式
          1. 1.execute - validate
          2. 2.execute - ActionName_validation.xml
          3. 3.others method - validateXxx
          4. 3.others method - ActionName_alias_validation.xml
          5. 验证标签:actionerror、fielderror
  6. 国际化+拦截器+ajax
    1. 国际化
      1. 语言-区域
        1. zh_CN
        2. zh_TW
        3. en_US
        4. en_GB
        5. ar-...
      2. resources_语言_区域.properties
      3. struts2.xml配置struts.custome.i18n.resources
      4. JSP:text标签
      5. JSP:其他标签key
      6. Action:super.getText("key")
      7. JSP:property标签 value="getText('key')"
      8. ***.validate.xml:message标记key属性
    2. 拦截器
      1. 用于拦截Action,在Action执行前后去执行其他代码
      2. struts2内置的拦截器
        1. fileUpload
        2. params
        3. ... ...
      3. 自定义拦截器
        1. 1.实现接口:Interceptor
        2. 2.继承类:AbstractInterceptor
        3. 3.继承类:MethodFilterInterceptor
      4. 拦截器栈
        1. 多个拦截器组成的集合
    3. ajax
      1. 1.导入jar包2个
      2. 2.package extends json-default
      3. action - result - type == json
      4. ajax返回的结果为action类中所有的属性
        1. includeProperties
        2. excludeProperties
    4. 文件上传
      1. 1.添加jar包2个
      2. 2.Action添加属性
        1. File img
        2. String imgFileName
        3. String imgContentType
      3. struts.xml设置fileUpload拦截器的参数
      4. 多文件上传
        1. 将Action中的属性该为List<T>