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

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

    SpringMVC它隶属于Spring框架,它只是Spring这个庞大框架下的一个小模块,SpringMVC是替换我们之前学过的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

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    免备案 国外服务器 vps 推荐以及优惠码
    VSCode 实时预览 HTML 页面
    VPS 上安装 Nginx 就是这么简单
    Thinkphp 5 验证码无法正常显示的排错以及解决方案 【已解决】
    Composer 安装 topthink/think-captcha 时报错 requires topthink/framework ^6.0.0 【已解决】
    Linux ps命令
    MySQL 查询不区分大小写的问题以及编码格式问题
    Cyberduck 小黄鸭 跨平台的 FTP 软件
    MySQL 存储过程 详解
    php 四舍五入保留两位小数,自动补齐0
  • 原文地址:https://www.cnblogs.com/jiangxiulian/p/5917832.html
Copyright © 2011-2022 走看看