简体   繁体   中英

Fastest way to toggle <secure> true or false inside web.xml

I'm developing a java base app which has to be deployed in PROD to Google App Engine. I need the set the <secure>true</secure> flag inside web.xml when comes time to deploy to PROD. However I'm testing with my appengine:devserver on my workstation and I'm using http (not https) so I have to set it to <secure>false</secure> or comment it out.

Question: what's the easiest way to automate this? I know it's possible with maven profiles but is there something Google plugin for Eclipse made or another way I'm missing? My project is Maven based and I'm starting the devserver either from command line or within the IDE...

Have you tried SessionCookieConfig and setting it programmatically? (eg: depending on environment variables)

I discovered that if I start only the webapp using appengine:devserver we don't need to care about true. So this is not a problem if I simply change the way I start the webapp. The problem occurs only if you start the webapp with Tomcat, jBoss or your own jetty server. However I consider a good practice to be able to run the application from something else than GAE just to be sure we aren't binded to a specific engine (server agnostic pattern)...

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