您遇到的问题:
- 使用 Gradle 将应用程序部署到 Gcloud 上的 AppEngine 后,默认网页是 index.html。但在网络上.xml宣称:<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
在本地环境中,它从索引开始.jsp正如我预期和声明的那样,但在部署之后不是
您期望发生的情况:
- 应用程序从索引.jsp页面开始。 正如它所宣布的那样
我使用 Gradle 部署到 appEngine https://github.com/GoogleCloudPlatform/app-gradle-plugin
在将其添加到web.xml
文件中后,我遵循了:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
我的应用程序从index.jsp
文件开始,即使也有index.html
文件。
我还与您分享我的build.gradle
文件的App Engine部分:
appengine { // App Engine tasks configuration
deploy { // deploy configuration
projectId = System.getenv('GOOGLE_CLOUD_PROJECT')
version = 'GCLOUD_CONFIG'
}
}