zoukankan      html  css  js  c++  java
  • 复习ssm02

    1. 课前回顾

     

    Springmvc  高级参数绑定  数组  List

    <input type  name=ids />  多个

    方法 (Integer[] ids)  QueryVo (里面Integer[] ids)

    方法(QueryVo 里面List<Items> itemList

    <input type  name=itemList[${s.index}].name />

     

     

    2. REquestMapping 处理器映射器(找此标签  路径 )

    Value = {多个路径,}

    Value = {/item/sfdsf.action}  类头上

    Method=RequestMethod.POSTGET

    3、 Controller方法返回值

    三个

    ModelAndView  建议不使用 不解偶

    String   返回视图的路径   (形参 绑定Model )    重定向redirect:另一个方法的映射路径  forward:内部转发

    Void    异步请求使用

    3. 异常处理器

    预期、运行时

    自定义异常处理类 实现HandlerEexceptionResolver  

    Spring实现化 自定义的处理类

    未知异常

    CustomEexception 继承Eexception  

    4、 上传图片

    1Form  上传图片了  action上传路径

    2input type=file  name=picturePic

    3)接收此图片  形参上绑定 MultipartFile picturePic 接口

    4)配置此接口的实现类 Springmvc.xml配置CommonsMultipartFileResolver   id=multipartFileResolver

    5JSON数据交互

    应用场景:前端是各种  html Freemarker  JSP一个Servlet Java代码 jstl C

    浏览器 Ajax  发送JSON字符串 报文  

    6、拦截器

    拦截器 应用 (练习)

  • 相关阅读:
    面向接口程序设计思想实践
    Block Chain Learning Notes
    ECMAScript 6.0
    Etcd Learning Notes
    Travis CI Build Continuous Integration
    Markdown Learning Notes
    SPRING MICROSERVICES IN ACTION
    Java Interview Questions Summary
    Node.js Learning Notes
    Apache Thrift Learning Notes
  • 原文地址:https://www.cnblogs.com/MAPO/p/8472774.html
Copyright © 2011-2022 走看看