App Engine Java 8 servlet 3.1 and web.xml

2019-09-01 16:01发布

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条回答
姐就是有狂的资本
2楼-- · 2019-09-01 16:21

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/

查看更多
登录 后发表回答