Make it possible to override WebGoat context settings via environment variables

git-svn-id: http://webgoat.googlecode.com/svn/trunk@242 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
rogan.dawes 2008-01-10 10:14:17 +00:00
parent c31ef90a3d
commit 71330946f4

View File

@ -94,8 +94,12 @@ public class WebgoatContext {
}
private String getParameter(HttpServlet servlet, String key) {
return System.getProperty(key, servlet.getInitParameter(key));
String value = System.getenv().get(key);
if (value == null)
value = servlet.getInitParameter(key);
return value;
}
/**
* returns the connection string with the real path to the database
* directory inserted at the word PATH