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

  • 相关阅读:
    安全工具-Arachni
    Python读取本地文档内容并发送邮件
    Linux好用的工具命令
    kali 安装google chrome浏览器(离线手动)
    安全工具-Sparta
    安全工具-Hydra
    当年的程序员,如今已是父母,七个方法让孩子爱上学习!
    一个网站SEO优化方案
    发现2017年最好的CSS框架
    怎么样加快JavaScript加载和执行效率
  • 原文地址:https://www.cnblogs.com/chencn/p/12241560.html
Copyright © 2011-2022 走看看