Skip to content

Instantly share code, notes, and snippets.

@jyeary
Last active August 7, 2017 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jyeary/45c2213136884e42bb7748d4a12294d8 to your computer and use it in GitHub Desktop.
Save jyeary/45c2213136884e42bb7748d4a12294d8 to your computer and use it in GitHub Desktop.
//Substitute your target web application below.
ServletContext sc = request.getServletContext().getContext("/EnterpriseApplication1-war"); 
//An example of what you can see to prove a point
Map<String, ? extends ServletRegistration> map = sc.getServletRegistrations(); 
for (String key : map.keySet()) {    
sc.log("Registration " + map.get(key).getName());      
Map<String, String> params = sc.getServletRegistration(map.get(key).getName()).getInitParameters();    
for (String k : params.keySet()) {        
sc.log("\t" + k + " --> " + params.get(k));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment