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.国际化

  • 相关阅读:
    单例
    添加水印
    创建文件夹
    查看文件属性
    把pdf文档的每一页单独存为pdf文档
    倒序排列
    旋转pdf文件
    fnmatch用法
    glob遍历文件夹中的所有的内容
    LinkedList源码分析
  • 原文地址:https://www.cnblogs.com/chencn/p/12241560.html
Copyright © 2011-2022 走看看