List of usage examples for org.springframework.web.util WebUtils DEFAULT_WEB_APP_ROOT_KEY
String DEFAULT_WEB_APP_ROOT_KEY
To view the source code for org.springframework.web.util WebUtils DEFAULT_WEB_APP_ROOT_KEY.
Click Source Link
From source file:com.ineunet.knife.upload.WebPaths.java
/** * @return e.g. /Workspace/iNeunet/ioo/src/main/webapp *//*from w w w . ja v a2 s. c om*/ public static String getRootPath() { if (rootPath == null) { WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext(); if (webApplicationContext == null) { rootPath = System.getProperty(WebUtils.DEFAULT_WEB_APP_ROOT_KEY); } else { ServletContext servletContext = webApplicationContext.getServletContext(); rootPath = servletContext.getRealPath("/"); } } return rootPath; }