Added ability to specify context-params in the project file. #192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If you're building a project which may be delivered as an executable jar file, it's obvious that parameters can (and should) be supplied as environment variables. However, if you're delivering a project as a war file to be run within a servlet container, this isn't really possible as the war file may be deployed into an already running servlet engine whose environment variables one cannot readily alter.
While I agree that passing parameters as
context-params
in theweb.xml
file violates the principles of the 12 factor app, it is a well established mechanism for specifying parameters within the context of a web-app packaged as a war.This patch provides a mechanism for specifying context parameters in the
:ring
map of theproject.clj
file. A key:context-params
may be specified in this map; if it is specified, and its value is a map, then acontext-param
element will be generated in the generatedweb.xml
file for each key/value pair in that map.