App Engine Java 8 servlet 3.1 and web.xml

戏子无情 提交于 2020-01-06 07:25:41

问题


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.


回答1:


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/



来源:https://stackoverflow.com/questions/49648829/app-engine-java-8-servlet-3-1-and-web-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!