 
2019-01-08 14:21
@没牙的小朋友 
undertow.txt文件使用配置 
undertow.resourcePath=xxxxx/src/main/webapp
xxxxx是你子模块的文件夹name
 
2018-12-18 09:24
用switch吧,舒服点
String fileExtension = fileName.substring(fileName.lastIndexOf(".")+1);
        switch  (fileExtension.toLowerCase()) {
            case "bmp":
                return "image/bmp";
            case "gif":
                return "image/gif";
            case "jpeg":
            case "jpg":
            case "png":
                return "image/jpeg";
            case "html":
                return "text/html";
            case "txt":
                return "text/plain";
            case "vsd":
                return "application/vnd.visio";
            case "ppt":
            case "pptx":
                return "application/vnd.ms-powerpoint";
            case "doc":
            case "docx":
                return "application/msword";
            case "xml":
                return "text/xml";
            default:
                return "image/jpeg";
        }