public static String getWebRootPath(Class<?> cls) {
        String strPath = getProjectRootPath(cls);
        int index = strPath.indexOf("WEB-INF");  
        if (index > 0) {  
            strPath = strPath.substring(0, index);  
        } else {
            strPath = "";
        }
        return strPath;  
    }