简体   繁体   中英

Dynamic value for cookie secure flag at web.xml

I want to set the "cookie-config secure" flag on my web.xml dynamically based on my environment.

I know I can do this with maven build, but I want to make it a single war file that can be used in multi-environment instead of different war file.

Is there any way to set it based on my environment variable or parameter?

Just realized it easily can be achieved using Java system properties. Just need to add -Dsome.value on JAVA_OPTS And use ${some.value} at the web.xml file.

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