1.获得项目有路径
File file=new File("");
String root=(file.getAbsolutePath()+"\\WebContent").replace("\\", "/");
2获得本地路径
@RequestMapping(method = RequestMethod.PUT, value = "/{userId}/portrait/V1.0.json")
public @ResponseBody void putPortrait(@PathVariable String userId,
@RequestBody Map<String,String> data,HttpServletRequest request)
{
//String root = request.getSession().getServletContext().getRealPath("/");
}