1. 程式人生 > >spring boot: Whitelabel Error Page的解決方案 --轉載https://blog.csdn.net/sinat_31270499/article/details/822 spring boot: Whitelabel Error Page的解決方案

spring boot: Whitelabel Error Page的解決方案 --轉載https://blog.csdn.net/sinat_31270499/article/details/822 spring boot: Whitelabel Error Page的解決方案

spring boot: Whitelabel Error Page的解決方案

2016年12月15日 14:42:59 閱讀數:45099
													<span class="tags-box artic-tag-box">
							<span class="label">標籤:</span>
															<a data-track-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;con&quot;:&quot;springboot&quot;}" class="tag-link" href="http://so.csdn.net/so/search/s.do?q=springboot&amp;t=blog" target="_blank">springboot																</a><a data-track-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;con&quot;:&quot;whitelabel&quot;}" class="tag-link" href="http://so.csdn.net/so/search/s.do?q=whitelabel&amp;t=blog" target="_blank">whitelabel																</a><a data-track-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;con&quot;:&quot;404&quot;}" class="tag-link" href="http://so.csdn.net/so/search/s.do?q=404&amp;t=blog" target="_blank">404																</a>
						<span class="article_info_click">更多</span></span>
																				<div class="tags-box space">
							<span class="label">個人分類:</span>
															<a class="tag-link" href="https://blog.csdn.net/u014788227/article/category/5896273" target="_blank">spring/springboot																</a>
						</div>
																							</div>
			<div class="operating">
													</div>
		</div>
	</div>
</div>
<article class="baidu_pl">
	<div id="article_content" class="article_content clearfix csdn-tracking-statistics" data-pid="blog" data-mod="popu_307" data-dsm="post">
							<div class="article-copyright">
              					
				版權宣告:本文為博主原創文章,未經博主允許不得轉載。					https://blog.csdn.net/u014788227/article/details/53670112				</div>
							            <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-d7e2a68c7c.css">
					<div class="htmledit_views" id="content_views">

          初次使用spring boot,按照其官網Building a RESTful Web Service搭建執行一個demo,程式碼如下:

pom.xml


  
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion
    >
    4.0.0 </modelVersion>
  5. <groupId>personal.timeless </groupId>
  6. <artifactId>CommentSystem </artifactId>
  7. <packaging>war </packaging>
  8. <version>0.0.1-SNAPSHOT </version>
  9. <name>CommentSystem Maven Webapp </name>
  10. <url>http://maven.apache.org </url>
  11. <parent>
  12. <groupId>org.springframework.boot </groupId>
  13. <artifactId>spring-boot-starter-parent </artifactId>
  14. <version>1.4.2.RELEASE </version>
  15. </parent>
  16. <dependencies>
  17. <dependency>
  18. <groupId>org.springframework.boot </groupId>
  19. <artifactId>spring-boot-starter-web </artifactId>
  20. </dependency>
  21. <dependency>
  22. <groupId>org.springframework.boot </groupId>
  23. <artifactId>spring-boot-starter-test </artifactId>
  24. <scope>test </scope>
  25. </dependency>
  26. <dependency>
  27. <groupId>com.jayway.jsonpath </groupId>
  28. <artifactId>json-path </artifactId>
  29. <scope>test </scope>
  30. </dependency>
  31. </dependencies>
  32. <properties>
  33. <java.version>1.8 </java.version>
  34. </properties>
  35. <build>
  36. <plugins>
  37. <plugin>
  38. <groupId>org.springframework.boot </groupId>
  39. <artifactId>spring-boot-maven-plugin </artifactId>
  40. </plugin>
  41. </plugins>
  42. </build>
  43. <repositories>
  44. <repository>
  45. <id>spring-releases </id>
  46. <url>https://repo.spring.io/libs-release </url>
  47. </repository>
  48. </repositories>
  49. <pluginRepositories>
  50. <pluginRepository>
  51. <id>spring-releases </id>
  52. <url>https://repo.spring.io/libs-release </url>
  53. </pluginRepository>
  54. </pluginRepositories>
  55. </project>

controller Comment.java


  
  1. import org.springframework.web.bind.annotation.RequestMapping;
  2. import org.springframework.web.bind.annotation.RequestParam;
  3. import org.springframework.web.bind.annotation.RestController;
  4. @RestController
  5. public class Comments {
  6. @RequestMapping( "/greeting")
  7. public String greeting(@RequestParam(value="name", defaultValue="World") String name) {
  8. return name;
  9. }
  10. }

主檔案 App.java


  
  1. import org.springframework.boot.SpringApplication;
  2. import org.springframework.boot.autoconfigure.SpringBootApplication;
  3. @SpringBootApplication
  4. public class App
  5. {
  6. public static void main(String[] args) throws Exception {
  7. SpringApplication.run(App.class, args);
  8. }
  9. }

執行起來沒報錯,但是開啟瀏覽器輸入地址http://localhost:8080/greeting出現以下頁面

檢查地址沒問題,核對jar包也正確。google,有說少jar包,按照回答新增以後也無濟於事。折騰了一會找到了原因

竟然時目錄檔案結構問題,最後附上官網說明http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-structuring-your-code


  
  1. 14.2 Locating the main application class
  2. We generally recommend that you locate your main application class in a root package above other classes. The @EnableAutoConfiguration annotation is often placed on your main class, and it implicitly defines a base “search package” for certain items. For example, if you are writing a JPA application, the package of the @EnableAutoConfiguration annotated class will be used to search for @Entity items.
  3. Using a root package also allows the @ComponentScan annotation to be used without needing to specify a basePackage attribute. You can also use the @SpringBootApplication annotation if your main class is in the root package.
  4. Here is a typical layout:
  5. com
  6. +- example
  7. +- myproject
  8. +- Application.java
  9. |
  10. +- domain
  11. | +- Customer.java
  12. | +- CustomerRepository.java
  13. |
  14. +- service
  15. | +- CustomerService.java
  16. |
  17. +- web
  18. +- CustomerController.java


				<script>
					(function(){
						function setArticleH(btnReadmore,posi){
							var winH = $(window).height();
							var articleBox = $("div.article_content");
							var artH = articleBox.height();
							if(artH > winH*posi){
								articleBox.css({
									'height':winH*posi+'px',
									'overflow':'hidden'
								})
								btnReadmore.click(function(){
									if(typeof window.localStorage === "object" && typeof window.csdn.anonymousUserLimit === "object"){
										if(!window.csdn.anonymousUserLimit.judgment()){
											window.csdn.anonymousUserLimit.Jumplogin();
											return false;
										}else if(!currentUserName){
											window.csdn.anonymousUserLimit.updata();
										}
									}
									
									articleBox.removeAttr("style");
									$(this).parent().remove();
								})
							}else{
								btnReadmore.parent().remove();
							}
						}
						var btnReadmore = $("#btn-readmore");
						if(btnReadmore.length>0){
							if(currentUserName){
								setArticleH(btnReadmore,3);
							}else{
								setArticleH(btnReadmore,1.2);
							}
						}
					})()
				</script>
				</article>
<div class="comment-edit-box d-flex">
	<a id="commentsedit"></a>
	<div class="user-img">
		<a href="//me.csdn.net/qq_39429288" target="_blank">
			<img class="" src="https://avatar.csdn.net/6/2/D/3_qq_39429288.jpg">
		</a>
	</div>
	<form id="commentform">
		<input type="hidden" id="comment_replyId">
		<textarea class="comment-content" name="comment_content" id="comment_content" placeholder="想對作者說點什麼"></textarea>
		<div class="opt-box"> <!-- d-flex -->
			<div id="ubbtools" class="add_code">
				<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
			</div>
			<input type="hidden" id="comment_replyId" name="comment_replyId">
			<input type="hidden" id="comment_userId" name="comment_userId" value="">
			<input type="hidden" id="commentId" name="commentId" value="">
			<div style="display: none;" class="csdn-tracking-statistics tracking-click" data-mod="popu_384"><a href="#" target="_blank" class="comment_area_btn">發表評論</a></div>
			<div class="dropdown" id="myDrap">
				<a class="dropdown-face d-flex align-items-center" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
				<div class="txt-selected text-truncate">新增程式碼片</div>
				<svg class="icon d-block" aria-hidden="true">
					<use xlink:href="#csdnc-triangledown"></use>
				</svg>
				</a>
				<ul class="dropdown-menu" id="commentCode" aria-labelledby="drop4">
					<li><a data-code="html">HTML/XML</a></li>
					<li><a data-code="objc">objective-c</a></li>
					<li><a data-code="ruby">Ruby</a></li>
					<li><a data-code="php">PHP</a></li>
					<li><a data-code="csharp">C</a></li>
					<li><a data-code="cpp">C++</a></li>
					<li><a data-code="javascript">JavaScript</a></li>
					<li><a data-code="python">Python</a></li>
					<li><a data-code="java">Java</a></li>
					<li><a data-code="css">CSS</a></li>
					<li><a data-code="sql">SQL</a></li>
					<li><a data-code="plain">其它</a></li>
				</ul>
			</div>  
			<div class="right-box">
				<span id="tip_comment" class="tip">還能輸入<em>1000</em>個字元</span>
				<input type="submit" class="btn btn-sm btn-red btn-comment" value="發表評論">
			</div>
		</div>
	</form>
</div>

	<div class="comment-list-container">
	<a id="comments"></a>
	<div class="comment-list-box"><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="8685187" data-replyname="u010440816">        <a target="_blank" href="https://me.csdn.net/u010440816"><img src="https://avatar.csdn.net/6/3/F/3_u010440816.jpg" alt="u010440816" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/u010440816"><span class="name ">果露酒:</span></a>              <span class="comment">百度了一天,終於好了,非常感謝。</span><span class="date" title="2018-11-08 15:29:09">(1個月前</span><span class="floor-num">#20樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="8177000" data-replyname="vop444">        <a target="_blank" href="https://me.csdn.net/vop444"><img src="https://avatar.csdn.net/D/7/F/3_vop444.jpg" alt="vop444" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/vop444"><span class="name ">若有光o:</span></a>              <span class="comment">並沒有解決問題,但是依然感謝作者</span><span class="date" title="2018-07-03 15:38:38">(5個月前</span><span class="floor-num">#19樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="8123636" data-replyname="niangou0915">        <a target="_blank" href="https://me.csdn.net/niangou0915"><img src="https://avatar.csdn.net/D/A/9/3_niangou0915.jpg" alt="niangou0915" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/niangou0915"><span class="name ">馬老師的大弟子:</span></a>              <span class="comment">我也遇到了這個報錯,網上都是說是目錄有問題,但是我目錄肯定是對的,後來發現我用的是@Controller註解,改成@RestController就好了,因為你返回的是字串不是模板</span><span class="date" title="2018-06-19 21:15:26">(6個月前</span><span class="floor-num">#18樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="8108052" data-replyname="hemingming1">        <a target="_blank" href="https://me.csdn.net/hemingming1"><img src="https://avatar.csdn.net/6/9/1/3_hemingming1.jpg" alt="hemingming1" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/hemingming1"><span class="name ">hemingming1:</span></a>              <span class="comment">很好的分享</span><span class="date" title="2018-06-13 11:27:23">(6個月前</span><span class="floor-num">#17樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7997446" data-replyname="qq_32157851">        <a target="_blank" href="https://me.csdn.net/qq_32157851"><img src="https://avatar.csdn.net/1/A/9/3_qq_32157851.jpg" alt="qq_32157851" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/qq_32157851"><span class="name ">非衣鯤化:</span></a>              <span class="comment">完美的解決了問題</span><span class="date" title="2018-05-29 16:47:14">(6個月前</span><span class="floor-num">#16樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7978818" data-replyname="single_fire">        <a target="_blank" href="https://me.csdn.net/single_fire"><img src="https://avatar.csdn.net/4/B/F/3_single_fire.jpg" alt="single_fire" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/single_fire"><span class="name ">single_fire:</span></a>              <span class="comment">大神,我找了一下下午錯誤,還是沒有找到bug在哪裡?你能否分享一下原始碼?</span><span class="date" title="2018-05-24 15:02:26">(7個月前</span><span class="floor-num">#15樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-read-reply" data-type="readreply">查看回復(1)</a><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li><li class="replay-box"><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="8039339" data-replyname="qq_41949030">        <a target="_blank" href="https://me.csdn.net/qq_41949030"><img src="https://avatar.csdn.net/6/4/4/3_qq_41949030.jpg" alt="qq_41949030" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/qq_41949030"><span class="name mr-8">qq_41949030</span></a>回覆  <span class="name">single_fire:</span>              <span class="comment">把你執行的controller和action放在同一目錄下</span><span class="date" title="2018-06-06 16:42:22">(6個月前</span>)<span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul></li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7878944" data-replyname="ly287759528">        <a target="_blank" href="https://me.csdn.net/ly287759528"><img src="https://avatar.csdn.net/F/8/A/3_ly287759528.jpg" alt="ly287759528" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/ly287759528"><span class="name ">ly287759528:</span></a>              <span class="comment">所有方法都試遍了,還是這個錯誤</span><span class="date" title="2018-04-28 15:20:57">(7個月前</span><span class="floor-num">#14樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7848442" data-replyname="kmesky">        <a target="_blank" href="https://me.csdn.net/kmesky"><img src="https://avatar.csdn.net/4/F/A/3_kmesky.jpg" alt="kmesky" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/kmesky"><span class="name ">kmesky:</span></a>              <span class="comment">解決了,贊</span><span class="date" title="2018-04-20 15:31:14">(8個月前</span><span class="floor-num">#13樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7731406" data-replyname="flysun3344">        <a target="_blank" href="https://me.csdn.net/flysun3344"><img src="https://avatar.csdn.net/7/2/F/3_flysun3344.jpg" alt="flysun3344" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/flysun3344"><span class="name ">flysun3344:</span></a>              <span class="comment">對的,controller要寫在Application所對應的包下面才可以。因為spring只會掃描主類包下面所有的class</span><span class="date" title="2018-03-24 23:31:18">(9個月前</span><span class="floor-num">#12樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-read-reply" data-type="readreply">查看回復(1)</a><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li><li class="replay-box"><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7965090" data-replyname="m0_37834114">        <a target="_blank" href="https://me.csdn.net/m0_37834114"><img src="https://avatar.csdn.net/7/F/A/3_m0_37834114.jpg" alt="m0_37834114" class="avatar"></a>          <div class="right-box reply-box">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/m0_37834114"><span class="name mr-8">城南無舊事</span></a>回覆  <span class="name">flysun3344:</span>              <span class="comment">表示寫在這個目錄下仍然有這個問題。url對映都沒問題</span><span class="date" title="2018-05-20 17:33:34">(7個月前</span>)<span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul></li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7679099" data-replyname="baidu_35468322">        <a target="_blank" href="https://me.csdn.net/baidu_35468322"><img src="https://avatar.csdn.net/1/8/5/3_baidu_35468322.jpg" alt="baidu_35468322" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/baidu_35468322"><span class="name ">wangsaisoon:</span></a>              <span class="comment">謝謝博主  問題已解決</span><span class="date" title="2018-03-10 19:38:03">(9個月前</span><span class="floor-num">#11樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7622919" data-replyname="qq_35179165">        <a target="_blank" href="https://me.csdn.net/qq_35179165"><img src="https://avatar.csdn.net/D/E/D/3_qq_35179165.jpg" alt="qq_35179165" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/qq_35179165"><span class="name ">fang大大:</span></a>              <span class="comment">謝謝,對初學者來講,在我快要放棄的時候能看到這篇文章真是太好了</span><span class="date" title="2018-02-26 10:24:21">(9個月前</span><span class="floor-num">#10樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7591189" data-replyname="qq_32155027">        <a target="_blank" href="https://me.csdn.net/qq_32155027"><img src="https://avatar.csdn.net/D/B/C/3_qq_32155027.jpg" alt="qq_32155027" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/qq_32155027"><span class="name ">軒轅醉傾城:</span></a>              <span class="comment">麻蛋 找了 一下午 果然是 這個 原因 網上基本沒有 說 是因為 這個</span><span class="date" title="2018-02-06 16:53:54">(10個月前</span><span class="floor-num">#9樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7554263" data-replyname="chunnuanhuakai1942">        <a target="_blank" href="https://me.csdn.net/chunnuanhuakai1942"><img src="https://avatar.csdn.net/3/2/F/3_chunnuanhuakai1942.jpg" alt="chunnuanhuakai1942" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/chunnuanhuakai1942"><span class="name ">chunnuanhuakai1942:</span></a>              <span class="comment">同樣的問題,也幫助我解決了問題。確實是專案目錄問題。spring boot 初學者。</span><span class="date" title="2018-01-28 09:54:49">(10個月前</span><span class="floor-num">#8樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7458999" data-replyname="u014788227">        <a target="_blank" href="https://me.csdn.net/u014788227"><img src="https://avatar.csdn.net/C/A/6/3_u014788227.jpg" alt="u014788227" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/u014788227"><span class="name ">timelessmemoryli:</span></a>              <span class="comment">一個問題的出現不可能只有一種原因,我只是提供我的解決方案,如果解決不了那就去結合你的實際情況尋找原因,而不是抱怨。</span><span class="date" title="2017-12-27 09:12:12">(11個月前</span><span class="floor-num">#7樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="7437163" data-replyname="a964001511">        <a target="_blank" href="https://me.csdn.net/a964001511"><img src="https://avatar.csdn.net/9/F/5/3_a964001511.jpg" alt="a964001511" class="avatar"></a>          <div class="right-box ">            <div class="info-box">              <a target="_blank" href="https://me.csdn.net/a964001511"><span class="name ">學碼烏鴉:</span></a>              <span class="comment">有幫助,解決了,謝謝</span><span class="date" title="2017-12-19 14:17:38">(1年前</span><span class="floor-num">#6樓)</span><span class="opt-box"><a class="btn btn-link-blue btn-report" data-type="report">舉報</a><a class="btn btn-link-blue btn-reply" data-type="reply">回覆</a></span></div>          </div>        </li></ul></div>
	<div id="commentPage" class="pagination-box" style="display: block;"><div id="Paging_05009901281280746" class="ui-paging-container"><ul><li class="js-page-first js-page-action ui-pager ui-pager-disabled"></li><li class="js-page-prev js-page-action ui-pager ui-pager-disabled">上一頁</li><li data-page="1" class="ui-pager focus">1</li><li data-page="2" class="ui-pager">2</li><li class="js-page-next js-page-action ui-pager">下一頁</li><li class="js-page-last js-page-action ui-pager"></li></ul></div></div>
	
</div>

Whitelabel Error Page 404 spring boot初學 訪問templates出錯解決方法

05-09 2364

百度了一上午絕大部分答案都是*Application啟動類應該在父級包如果這個專案的啟動類的位置絕對沒問題,但是還是報404!可以嘗試如下方法將右側依賴的包在左邊依次找到然後全部刪除左邊的jar ,然... 來自: u013986038的部落格

		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/expect521/article/details/77883761,BlogCommendFromBaidu_1,index_1&quot;}" data-flg="true">
		<div class="content" style="width: 842px;">
			<a href="https://blog.csdn.net/expect521/article/details/77883761" target="_blank" title="Whitelabel Error Page(1)之 Not Found">
			<h4 class="text-truncate oneline" style="width: 748px;">
					<em>Whitelabel</em> <em>Error</em> <em>Page</em>(1)之 Not Found				</h4>
			<div class="info-box d-flex align-content-center">
				<!-- <p class="avatar">
						<img src="https://avatar.csdn.net/E/5/6/3_expect521.jpg" alt="expect521" class="avatar-pic">
						<span class="namebox">
							<span class="name">expect521</span>
							<span class="triangle"></span>
						</span>
				</p> -->
				<p class="date-and-readNum">
					<span class="date hover-show">09-07</span>
					<span class="read-num hover-hide">
						<svg class="icon csdnc-yuedushu" aria-hidden="true">
							<use xlink:href="#csdnc-m-passwords-visible"></use>
						</svg>
						1.3萬</span>
					</p>
				</div>
			</a>
				<p class="content" style="width: 842px;">
					<a href="https://blog.csdn.net/expect521/article/details/77883761" target="_blank" title="Whitelabel Error Page(1)之 Not Found">
						<span class="desc oneline">Whitelabel Error Page

訪問路勁
出錯原因
程式碼塊
程式碼功能
程式碼解釋
例項如下
分析出錯思路
解決方法
方法一新增程式碼 RequestMapping
方法二新增程式碼 Reques…

來自: expect521的部落格



		<div class="recommend-item-box recommend-box-ident" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://bbs.csdn.net/topics/392187702,BlogCommendFromBaidu_2,index_2&quot;}" data-flg="true">
	<a href="https://bbs.csdn.net/topics/392187702" target="_blank">
		<h4 class="text-truncate oneline" style="width: 731px;">
				<em>Spring</em><em>Boot</em>整合jsp,訪問時頁面報<em>Whitelabel</em> <em>Error</em> <em>Page</em>,怎麼解決?求大神幫忙啊啊 啊啊 啊			</h4>
		<div class="info-box d-flex align-content-center">
			<p>
							</p>
			<p>
				<span class="date">07-03</span>
			</p>
		</div>
		<p class="content oneline" style="width: 842px;">
				一樣的專案,我在eclipse上執行沒問題,在idea上報錯 然後同事用idea寫的一個springboot整合jsp的專案,執行這沒問題,然後我匯入後... 訪問頁面顯示Whitelabel Err			</p>
	</a>

</div>

<div class="recommend-item-box recommend-ad-box"><div id="kp_box_59" data-pid="59" data-track-click="{&quot;mod&quot;:&quot;kp_popu_59-718&quot;,&quot;con&quot;:&quot;,,&quot;}"><script src="https://nbrecsys.4paradigm.com/resource/cus/csdn/sdk-csdn-render.js"></script>
		<div class="recommend-item-box recommend-box-ident type_blog clearfix" data-track-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;con&quot;:&quot;,https://blog.csdn.net/github_32521685/article/details/50198467,BlogCommendFromBaidu_3,index_3&quot;}" data-flg="true">
		<div class="content" style="width: 842px;">
			<a href="https://blog.csdn.net/github_32521685/article/details/50198467" target="_blank" title="Spring Boot自定義錯誤頁面,Whitelabel Error Page處理方式">
			<h4 class="text-truncate oneline" style="width: 748px;">
					<em>Spring</em> <em>Boot</em>自定義錯誤頁面,<em>Whitelabel</em> &l