栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Spring MVC配置教程+thymeleaf模板(注解版)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Spring MVC配置教程+thymeleaf模板(注解版)

ONE:创建maven项目

TWO:配置pom.xml文件

maven仓库

    //需要配置的三个jar包
 
            org.springframework
            spring-webmvc
            5.3.12



            org.thymeleaf
            thymeleaf
            3.0.9.RELEASE


            org.thymeleaf
            thymeleaf-spring4
            3.0.9.RELEASE

Three:配置web.xml文件

        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd" >


    Archetype Created Web Application
    
        SpringMVC
        org.springframework.web.servlet.DispatcherServlet
        
        
            contextConfigLocation
            classpath:mvc-dispatcher-servlet.xml
        
        
        1
    

    
    
        SpringMVC
        /
    

four:添加springMVC配置文件



    

    


    
    
        
        
        
        
        
        
    

    
        
    

    
        
        
    

Five:创建实例类编写mvc代码



    

    


    
    
        
        
        
        
        
        
    

    
        
    

    
        
        
    

接下来配置 thymeleaf 上面的pom.xml中已经给配置好了 也已经在springMVC配置文件中配置了,所以接下来就要开始编写了,所以配置thymeleaf 可为三部

        (1在pom中注册

          (2)在web.xml中配置

          (3)在web-inf中编写.html

编写一下.html:需要注意




    
    Title


    

1、转义字符输出

配置完成!o了(个人笔记,勿喷)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/439951.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号