public static String getContextPath ( ServletContext servletContext ) { String contextPath = DEFAULT_CONTEXT_PATH ; // Get the context path if ( servletContext != null ) { contextPath = servletContext . getContextPath ( ) ; if ( StringUtils . isEmpty ( contextPath ) ) { contextPath = DEFAULT_CONTEXT_PATH ; } } return contextPath ; }
Returns the context path associated to the servlet context