zoukankan      html  css  js  c++  java
  • Java web Springboot

    1.Spring boot  阅读源码:需要看 1 和  2两项内容。

         ⒈. XXXAutoConfiguration :获取自动xxx的配置类

      ⒉.XXXProperties:自动配置类装配配置文件中自定义的内容

        ⒊. 导入静态资源:webMvcAutoConfiguration   webMvcAutoConfigurationAdapter     webMvcProperties    addResourceHandler

          可以放置静态资源的几个位置:

          1.classpath指springboot工程src目录下的resource目录:

          2.路径:maven:   /webjars/**

          3.classpath:/META-INF/resources/ ; classpath:/resources/;   classpath:/public/;   classpath:/static/;     优先级: resource>static>public

                          4.templates目录下所有页面html,只能通过对应的controller访问;通过thymeleaf模板引擎访问;

                         

               

                           

         4.首页    

          1.http://localhost:8080/   访问/首页 顺序:(静态资源访问顺序)              

                                           1.  resources/META-INF/resources/index.html   

                                           2.  resources/resource/index.html   

                                           3.  resources/static/index.html     

                                           4.  resources/public/index.html

         2.favicon:  <link rel="shortcut icon" href="/favicon.ico"/>    /resources/** 静态文件夹底下加图片favicon.ico

            

       5.JSP 模板引擎thymeleaf  :<html xmlns:th="http://www.thymeleaf.org">  

             1./resources/templates/*.html 下的所有html页面,都有thymeleaf引擎模板接管。
    2.thymeleaf语法规则:th:元素名
          读取model.addAttribute(key,value)====>th:text="${xx}"
    读取model.addAttribute(key,"html代码块") th:utext="${代码块}"不转义
    读取model.addAttribute(keys,Arrays.asList("语文","数学")) 循环结构读取: th:each="key:${keys}" th:text="${key} [[${key}]]
            URL @{}
              if then if ? then
         3.thymeleaf Properties配置:访问 前缀:/resources/templates/; 后缀: *.html;

       6.装配扩展SpringMVC:

       7.增删改查

       8.拦截器

       9.国际化

  • 相关阅读:
    Windows程序设计6(内存、线程、进程)
    Windows程序设计5(MDI、库程序、文件)
    Windows程序设计4(文字、对话框、各控件)
    大数据开发学习之构建Hadoop集群-(0)
    杂谈
    Windows程序设计2(消息机制、菜单)
    QT 学习笔记概述(一)
    Linux/Windows 实用工具简记
    读书笔记《深度探索c++对象模型》(0)
    读书笔记《深入理解计算机系统》(第三版) 概述
  • 原文地址:https://www.cnblogs.com/chencn/p/12241560.html
Copyright © 2011-2022 走看看