摘要: String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";path:/ArchManagebasePath:http://localhost:8080/ArchManage/相对路径,在tomcat或者netware里面可能出现不一致导致异常,这样写死来,比较好一点。注意最后的basePath中是有/的。 阅读全文