0

有一个带有 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 页面

4

2 回答 2

0

我假设你有任何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 />

如果您有基于注释的配置,您可以搜索上述配置的注释。

于 2016-05-25T02:59:44.620 回答
0

尝试更换

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

<welcome-file>app/index.html</welcome-file>
于 2016-05-24T15:09:26.880 回答