Added ability to specify context-params in the project file.#192
Open
simon-brooke wants to merge 1 commit intoweavejester:masterfrom
Open
Added ability to specify context-params in the project file.#192simon-brooke wants to merge 1 commit intoweavejester:masterfrom
simon-brooke wants to merge 1 commit intoweavejester:masterfrom
Conversation
MichaelBlume
requested changes
Sep 10, 2017
Collaborator
MichaelBlume
left a comment
There was a problem hiding this comment.
Minor nitpic, otherwise looks good.
| "Take this `params-map` and construct from it a sequence of | ||
| s-expression representations of context-param elements." | ||
| [params-map] | ||
| (if |
Collaborator
There was a problem hiding this comment.
This should be a when, since it doesn't appear to have an else clause
dijonkitchen
reviewed
Mar 3, 2019
| "Take this `params-map` and construct from it a sequence of | ||
| s-expression representations of context-param elements." | ||
| [params-map] | ||
| (if |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-paramsin theweb.xmlfile 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
:ringmap of theproject.cljfile. A key:context-paramsmay be specified in this map; if it is specified, and its value is a map, then acontext-paramelement will be generated in the generatedweb.xmlfile for each key/value pair in that map.