本文介绍了将App Engine servlet-api-2.5升级到servlet-api-3.1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着最近宣布支持Servlet 3.1,我无法弄清楚如何在非Maven版本中修改App Engine标准环境以使用3.1而不是2.5.

With the recent announcement of support for Servlet 3.1, I cannot figure out how to modify the App Engine Standard environment to use 3.1 instead of 2.5 in a non-Maven build.

似乎没有办法升级到3.1?

It seems there is no way to upgrade to 3.1?

https://cloudplatform.googleblog.com/2017/06/Google-App-Engine-standard-now-supports-Java-8.html

推荐答案

以下是此处提供的完整示例: https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/appengine-standard-java8/helloworld

还附有运行程序.

对于非Maven用户,您可以使用gradle.

在gradle构建文件中,行号39表示: https://github.com/GoogleCloudPlatform/getting-started-java/blob/master/appengine-standard-java8/helloworld/build.gradle#L39

In gradle build file, line number 39 denotes: https://github.com/GoogleCloudPlatform/getting-started-java/blob/master/appengine-standard-java8/helloworld/build.gradle#L39

providedCompile 'javax.servlet:javax.servlet-api:3.1.0'

本地运行:

如果未安装gradle,则可以使用 ./gradlew appengineRun 运行.

If you do not have gradle installed, you can run using ./gradlew appengineRun.

要使用访问权限: http://localhost:8080/

在pom.xml中,行号62到70 表示它正在使用 servlet版本3.1.0 : https://github.com/GoogleCloudPlatform/getting-started-java/blob/master/appengine-standard-java8/helloworld/pom.xml#L66

In pom.xml, line number 62 to 70 denotes that it is using servlet version 3.1.0: https://github.com/GoogleCloudPlatform/getting-started-java/blob/master/appengine-standard-java8/helloworld/pom.xml#L66

<!-- [START servlet] -->
<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>3.1.0</version>
  <type>jar</type>
  <scope>provided</scope>
</dependency>
<!-- [END servlet] -->

希望它会澄清您.

这篇关于将App Engine servlet-api-2.5升级到servlet-api-3.1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 23:52