public static String getUrl ( String path ) { if ( path == null ) { return path ; } ServletContext sc = ExecutionContext . getSession ( ) . getServletContext ( ) ; if ( path . startsWith ( "jar:" ) ) { int i = path . indexOf ( "!" ) ; path = i < 0 ? path : path . substring ( ++ i ) ; } path = sc . getContextPath ( ) + path ; return path ; }
Returns a URL string representing the root path and context path .