简体   繁体   中英

App Engine Java 8 servlet 3.1 and web.xml

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM