code: protected ServletContext initServletContext(Document webXmlDoc,
  			String baseDirPath, String tmpDirPath, String springConfigFiles,
  			String servletAPIversion) {
  
  		// Parse the context parameters
  		MockServletContext servletContext = new MockServletContext(
  				servletAPIversion, baseDirPath, tmpDirPath);
  		Map<String, Object> servletContextInitParams = new HashMap<String, Object>();
  		NodeList contextParamsNodes = webXmlDoc
  				.getElementsByTagName(CONTEXT_TAG_NAME);
  		for (int i = 0; i < contextParamsNodes.getLength(); i++) {
  			Node node = contextParamsNodes.item(i);
  			initializeInitParams(node, servletContextInitParams);
  		}
  
  		// Override spring config file if needed
  		if (StringUtils.isNotEmpty(springConfigFiles)) {
  			servletContextInitParams.put(CONFIG_LOCATION_PARAM,
  					springConfigFiles.replace(" ", "%20"));
  		}
  
  		servletContext.setInitParameters(servletContextInitParams);
  		return servletContext;
  	}
docs: Initalize the servlet context
  
  @param webXmlDoc
  the web.xml document
  @param baseDirPath
  the base drectory path
  @param tmpDirPath
  the temp directory path
  @param springConfigFiles
  the list of spring config files
  @return the servlet context