当学习一个mvc框架步骤:
    1,环境搭建 实现 helloworld
    2,如何传递参数到Controller
    3,如何从控制器获取参数
    4,如何完成文件的上传
    5,如何完成验证
    6,如何处理异常
    7,深入学习一些原理,和源代码的学习

1,本笔记学习基于spring的jar包
    spring-framework-3.1.0.RC2-with-docs
2,spring中的几个概念
    Dispatcher servlet 中央控制器 转发器
    Handler Mapping 映射处理器
    Controller 控制器
    ViewResolver  视图转换器
    View 视图                   了解即可
3,环境搭建
    一,创建 web project
    二,拷贝 上述文件中dist文件下的所有jar包到lib目录下
    三,拷贝 common-logging 1.1.1 .jar
    四,配置Dispatcher Servlet
         在web.xml中 可以参考 doc下的帮助文档
           
                hello
                org.springframework.web.servlet.DispatcherServlet
                1
           


           
                hello
                /
           

            注意在此配置路径的时候要使用/ 不能写成/*  /*拦截所有的请求
    五,在WEB-INF下创建spring的配置文件 hello-servlet.xml
        注意配置文件的名字和servlet的名字是由关联的
        配置文件的内容如下,参考帮助文档
       
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:p="http://www.springframework.org/schema/p"
            xmlns:context="http://www.springframework.org/schema/context"
            xmlns:mvc="http://www.springframework.org/schema/mvc"
            xsi:schemaLocation="
                http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/context
                http://www.springframework.org/schema/context/spring-context-3.0.xsd
                http://www.springframework.org/schema/mvc
                http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
           
           
           
           
           

           

       

    六,创建Controller
        @Controller
        public class HelloContoller{
            @RequestMappging(value={"/","/hello"})
            public String hello () {
                return "hello";
            }
        }
    七,配置ViewResolvers试图转换器
           
             
             
             
           

            视图控制器解释
                return "hello";
                "/WEB-INF/jsp/" + "hello" + ".jsp" = "/WEB-INF/jsp/hello.jsp"
4,访问路径配置
    @RequestMapping(value = "/hello")
    @RequestMapping(value = {"/","/hello"})
5,参数的传递
    在要访问的方法中添加参数
    一,@RequestParam("userId") int id
    二,@RequestParam int id
    三,int id
    参数传递到页面
    一,Map map
        map.put("hello","haha");
         ${hello}
    二,Model model 推荐
        model.addAttribute("hello","value");
        //使用object类型作为key integer
        model.addAttribute(23);
6,怎么获取request和response
    直接添加参数
    HttpServletRequest request;
    HttpServletResponse response;
7,文件上传
    用到时候现查即可