App Engine Java 8 servlet 3.1和web.xml [英] App Engine Java 8 servlet 3.1 and web.xml

查看:150
本文介绍了App Engine Java 8 servlet 3.1和web.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我想使用servlet 3.1注释,并且想要确保对appengine应用程序的所有请求都是https。
为了保护网址,我需要使用web.xml 链接到文档
现在,如果我有web.xml和servlet 3.1注释,那么在本地测试时就没有问题了。但是,如果将相同的应用部署到Google Cloud Platform AppEngine,则无法识别注释。当将该应用程序部署到没有web.xml注释的GCP Appengine时,不会被识别。



现在的问题是,我可以同时在web.xml和注释上Appengine标准?我缺少一些简单/明显的东西吗?



任何帮助/向正确的方向推送都非常感谢。

解决方案

那么我确实将maven servlet 3.1依赖与web.xml 2.5部署描述符混淆了。一旦我确实使用了web.xml 3.1部署描述符,应用程序就开始按预期工作。 https://www.mkyong.com/web -development / the-web-xml-deployment-descriptor-examples /

My problem is that I want to use servlet 3.1 annotations and also want to make sure all requests to the appengine app are https. In order to secure the url I need to use web.xml link to docs. Now if I have both web.xml and servlet 3.1 annotations it's all fine when testing locally. However, when the same app is deployed to Google Cloud Platform AppEngine it fails to recognise the annotations. When deploying that app to GCP Appengine without web.xml annotations are than recognised.

Now the question is, can I have web.xml and annotation at the same time on the Appengine standard ? Am I missing something simple / obvious ?

Any help / push in a right direction is much appreciated.

解决方案

Well I did mixed up maven servlet 3.1 dependancy with web.xml 2.5 deployment descriptor. Once I did use the web.xml 3.1 deployment descriptor the app started to work as intended. https://www.mkyong.com/web-development/the-web-xml-deployment-descriptor-examples/

这篇关于App Engine Java 8 servlet 3.1和web.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆