zoukankan      html  css  js  c++  java
  • SpringMVC的环境搭建

    第一节 SpringMVC的环境搭建

    2016年3月7日 星期一

    09:04

     

    MyBatis框架-->持久层框架-->Object【对象】Relation[关系型数据库]Mapping[在MyBatis的体现是哪个映射文件中国的<resultMap>标签]框架  对JDBC的封装,需要定制SQL语句

    处理的是DataAccessOBject数据访问对象

     

    SpringMVC它隶属于Spring框架,它只是Spring这个庞大框架下的一个小模块,SpringMVC是替换我们之前学过的Servlet,在我们下面的课程的时候需要你回顾Servlet

     

    如何学习一个框架?

    1.找jar

    2.配置核心配置文件

    3.读取核心配置文件

    4.测试Hello World

    读取核心配置文件:MyBatis的时候,是由我们自己控制读取mybatis-config.xml Java

    SpringMVC框架,WEB层,动态Web项目

    第一步:找到Jar[19个]

    第二步:建立核心配置文件

     

    The DispatcherServlet is an actual Servlet (it inherits from the HttpServlet base class), and as such is declared in the web.xml[部署描述符] of your web application. You need to map requests that you want the DispatcherServlet to handle, by using a URL mapping in the same web.xml file. This is standard Java EE Servlet configuration; the following example shows such a DispatcherServlet declaration and mapping:

     

    Servlet的生命周期

    发送请求——>如果你是第一次访问获取使用服务器进行初始化操作 init()方法实例化

    --》service方法->判断用doget、dopost

    <load-on-startup>1</load-on-startup>

    <load-on-startup>当服务器启动的时候就对该Servlet实话,并且值越小越被优先加载</load-on-startup>

     

     

     

    JSP的生命周期[自己去百度]

     


    Upon initialization of a DispatcherServlet, Spring MVC looks for a file named [servlet-name]-servlet.xml in the WEB-INF directory of your web application and creates the beans defined there, overriding the definitions of any beans defined with the same name in the global scope.


     


     

     


     

     

     

    跳转:

    请求转发:地址栏路径不变[默认的跳转方式]

     

    重定向:地址栏改变


    配置视图解析器


     

     

     

     

    Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'homeController' method

     


     

     

     

     

     

     

     

  • 相关阅读:
    bzoj1432_[ZJOI2009]Function
    Luogu1681_ 最大正方形II
    初等数论-Base-2(扩展欧几里得算法,同余,线性同余方程,(附:裴蜀定理的证明))
    [bzoj2456] mode
    初等数论-Base-1(筛法求素数,欧拉函数,欧几里得算法)
    小程序之Tab切换
    vue-axios基本用法
    vue-过渡动画
    vue-router实例
    永恒之蓝漏洞利用复现
  • 原文地址:https://www.cnblogs.com/skycodefamily/p/5348194.html
Copyright © 2011-2022 走看看