簡體   English   中英

將index.html作為spring + angularJS應用程序中的歡迎頁面

[英]Index.html as welcome page in spring+angularJS application

有一個帶有SpringMVC + AngularJS的應用程序。 將index.html頁面放置在src / main / webapp / app / src / index.html中。

在web.xml中有

<welcome-file-list>  
  <welcome-file>index.html</welcome-file>  
</welcome-file-list> 

該應用程序適用於

http:// localhost:8080 / myapp / app / index.html

但不能使用http:// localhost:8080 / myapp進行哪些更改,以便將應用程序正確定向到index.html頁

嘗試更換

<welcome-file>index.html</welcome-file>

<welcome-file>app/index.html</welcome-file>

我假設您已配置了任何InternalResourceViewResolver 您必須進行2次更改。 1.更改web.xml中的歡迎文件,如下所示

<welcome-file-list>
    <welcome-file>app/src/index.html</welcome-file>
</welcome-file-list>`
  1. 更改下面的dispatcher-servlet.xml或任何配置文件<mvc:resources mapping="/app/src/**" location="/app/src/"/> <mvc:default-servlet-handler />

如果您具有基於注釋的配置,則可以通過Google搜索上述配置的注釋。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM