中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

邯鄲wap網(wǎng)站建設(shè)報(bào)價(jià)網(wǎng)上宣傳方法有哪些

邯鄲wap網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)上宣傳方法有哪些,淘寶網(wǎng)站開始怎么做的,電子商務(wù)網(wǎng)站建設(shè)學(xué)什么軟件目錄一、異常錯(cuò)誤二、原因三、解決方法方法1. 將無法編譯的靜態(tài)資源放入可編譯目錄下方法2. 重新編譯項(xiàng)目加載資源方法3. 修改pom.xml資源配置文件方法4. 不連接遠(yuǎn)程數(shù)據(jù)庫啟動(dòng),使用本地?cái)?shù)據(jù)庫一、異常錯(cuò)誤 Springboot使用thymeleaf,并連接遠(yuǎn)程數(shù)據(jù)庫啟…

目錄

  • 一、異常錯(cuò)誤
  • 二、原因
  • 三、解決方法
    • 方法1. 將無法編譯的靜態(tài)資源放入可編譯目錄下
    • 方法2. 重新編譯項(xiàng)目加載資源
    • 方法3. 修改pom.xml資源配置文件
    • 方法4. 不連接遠(yuǎn)程數(shù)據(jù)庫啟動(dòng),使用本地?cái)?shù)據(jù)庫

一、異常錯(cuò)誤

Springboot使用thymeleaf,并連接遠(yuǎn)程數(shù)據(jù)庫啟動(dòng)時(shí),無法加載resources中的靜態(tài)資源

瀏覽器報(bào)錯(cuò)

Failed to load resource: the server responded with a status of 404 ()

在這里插入圖片描述

后端啟動(dòng)時(shí)報(bào)錯(cuò)

Servlet.service() for servlet [dispatcherServlet] in context with path [/ce] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template 

在這里插入圖片描述
前端打開頁面時(shí)后端報(bào)錯(cuò)

Exception processing template "/web/studyOutline/studyOutline": Error resolving template [/web/studyOutline/studyOutline], template might not exist or might not be accessible by any of the configured Template Resolvers

在這里插入圖片描述

二、原因

打包編譯項(xiàng)目,顯示找不到j(luò)s、css、html等靜態(tài)資源,但本地路徑并沒有寫錯(cuò),于是我去找編譯文件,查看是不是靜態(tài)資源沒有編譯到,打開項(xiàng)目下的target文件夾

在這里插入圖片描述
前往classes文件夾,發(fā)現(xiàn)項(xiàng)目resources下對(duì)應(yīng)的templates韋文件夾沒有編譯到,缺少靜態(tài)資源,當(dāng)然會(huì)報(bào)錯(cuò)了

在這里插入圖片描述
在這里插入圖片描述

三、解決方法

方法1. 將無法編譯的靜態(tài)資源放入可編譯目錄下

既然服務(wù)器不能編譯templates文件夾,那么把templates文件夾放入calsses路徑下即可,這樣處理就能獲取templats下的靜態(tài)資源了,但如果靜態(tài)資源有改動(dòng),需要手動(dòng)放入classes文件夾下,再次啟動(dòng)項(xiàng)目即可讀取資源

在這里插入圖片描述
如果再次啟動(dòng)項(xiàng)目,還是顯示找不到j(luò)s、css、html等靜態(tài)資源,請(qǐng)看方法2

方法2. 重新編譯項(xiàng)目加載資源

由于服務(wù)器編譯攔截了靜態(tài)資源,導(dǎo)致出現(xiàn)異常,需要重新打包編譯

打開IDEA帶的Maven管理,雙擊clean清除由項(xiàng)目編譯創(chuàng)建的target

再雙擊install安裝jar包到本地倉庫
在這里插入圖片描述

項(xiàng)目打包出現(xiàn)異常

[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.

在這里插入圖片描述

系統(tǒng)默認(rèn)編碼是GBK,maven提升需要使用UTF-8,在setting中修改項(xiàng)目編碼為UTF-8

在這里插入圖片描述

在這里插入圖片描述

出現(xiàn) Failed to execute goal是由于測(cè)試用例有問題,

 Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-test) on project springboot_04_profile: Input length = 1 -> [Help 1]

在這里插入圖片描述

選擇跳過測(cè)試用例

在這里插入圖片描述

再次雙擊install,編譯成功,啟動(dòng)項(xiàng)目即可讀取靜態(tài)資源

在這里插入圖片描述
如果設(shè)置編碼還是打包失敗,或者顯示找不到j(luò)s、css、html等靜態(tài)資源,請(qǐng)看方法3

方法3. 修改pom.xml資源配置文件

如果設(shè)置編碼還是打包失敗,或者顯示找不到j(luò)s、css、html等靜態(tài)資源,說明服務(wù)器沒有訪問資源的權(quán)限,需要在pom.xml的build下引入資源文件

<!--           引入靜態(tài)資源文件   --><resources><resource><directory>src/main/resources</directory><includes><include>**/*.css</include><include>**/*.js</include><include>**/*.html</include><include>**/*.png</include><include>**/*.properties</include><include>**/*.yml</include><include>**/*.xml</include><include>**/*.conf</include></includes></resource></resources>

再次insall,顯示打包成功,瀏覽器404的問題也解決了,加載了靜態(tài)資源

在這里插入圖片描述

方法4. 不連接遠(yuǎn)程數(shù)據(jù)庫啟動(dòng),使用本地?cái)?shù)據(jù)庫

開頭說了,Springboot使用thymeleaf,并連接遠(yuǎn)程數(shù)據(jù)庫啟動(dòng)時(shí),無法加載resources中的靜態(tài)資源,這是一個(gè)大坑,如果不連接遠(yuǎn)程數(shù)據(jù)庫啟動(dòng),則不存在服務(wù)器訪問資源的問題

打開application.properties配置文件,注釋掉連接遠(yuǎn)程數(shù)據(jù)庫的代碼,改用本地?cái)?shù)據(jù)庫,就不會(huì)有訪問資源的問題了,可以直接加載,瀏覽器不再出現(xiàn)Failed to load resource問題

在這里插入圖片描述

異常索引

  • Failed to load resource: the server responded with a status of 404 ()
  • Servlet.service() for servlet [dispatcherServlet] in context with path [/ce] threw exception [Request processing failed; nested
    exception is org.thymeleaf.exceptions.TemplateInputException: Error
    resolving template
  • Exception processing template “/web/studyOutline/studyOutline”: Error resolving template [/web/studyOutline/studyOutline], template
    might not exist or might not be accessible by any of the configured
    Template Resolvers
  • [INFO] Using ‘UTF-8’ encoding to copy filtered resources. [INFO] Using ‘UTF-8’ encoding to copy filtered properties files.
  • Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources
    (default-test) on project springboot_04_profile: Input length = 1 ->
    [Help 1]
http://www.risenshineclean.com/news/21387.html

相關(guān)文章:

  • 萬網(wǎng)博通官網(wǎng)專業(yè)網(wǎng)站優(yōu)化排名
  • 學(xué)編程哪個(gè)機(jī)構(gòu)有權(quán)威慈溪seo
  • 龍巖網(wǎng)站開發(fā)鴻星爾克網(wǎng)絡(luò)營銷
  • 交友網(wǎng)站初期怎么做網(wǎng)絡(luò)營銷工具的特點(diǎn)
  • 做爰網(wǎng)站有哪些seo線下培訓(xùn)課程
  • 網(wǎng)站焦點(diǎn)圖制作教程百度網(wǎng)站快速優(yōu)化
  • 網(wǎng)站開發(fā)用python嗎seo技巧與技術(shù)
  • 網(wǎng)站讀取錯(cuò)誤時(shí)怎樣做愛站之家
  • 學(xué)校校園網(wǎng)站建設(shè)必要性全國免費(fèi)發(fā)布信息平臺(tái)
  • 網(wǎng)站建設(shè)合同標(biāo)的怎么寫西安樓市最新房?jī)r(jià)
  • 企業(yè)做英文網(wǎng)站什么關(guān)鍵詞可以搜到那種
  • 信譽(yù)比較好的網(wǎng)上做任務(wù)的網(wǎng)站百度熱搜廣告位
  • 幼教網(wǎng)站建設(shè)分析今日新聞國際最新消息
  • 青縣網(wǎng)站建設(shè)蘇州seo服務(wù)
  • 做網(wǎng)站開發(fā)語言哪里可以建網(wǎng)站
  • 南京網(wǎng)站制作有限公司fifa世界排名最新
  • 外貿(mào)做的亞馬遜網(wǎng)站是哪個(gè)百度一下知道首頁
  • wordpress 英文改中文seo顧問是什么職業(yè)
  • 中升乙源建設(shè)公司網(wǎng)站各大網(wǎng)站域名大全
  • 畢業(yè)設(shè)計(jì)購物網(wǎng)站怎么做上海網(wǎng)絡(luò)推廣團(tuán)隊(duì)
  • 國外花型設(shè)計(jì)網(wǎng)站2022真實(shí)新聞作文400字
  • win7做網(wǎng)站服務(wù)器seo的主要分析工具
  • 表白制作網(wǎng)站網(wǎng)站設(shè)計(jì)公司
  • 重慶網(wǎng)站制作招聘百度營銷
  • 專業(yè)做外貿(mào)網(wǎng)站推廣發(fā)帖網(wǎng)站
  • wordpress 純凈版下載地址seo是什么意思如何實(shí)現(xiàn)
  • 微網(wǎng)站技術(shù)重慶seo排名優(yōu)化
  • 網(wǎng)站如何做優(yōu)化重慶高端seo
  • 企業(yè)建站公司哪里有如何提高網(wǎng)站在百度的排名
  • 政府網(wǎng)站建設(shè)問題餐飲營銷方案