Java代码在/Obatv/src/com/obatv/sys/web/controller/UserControl.java
关键代码:
@ResponseBody
@RequestMapping(value = "/test1.do")
public String testPath1(HttpServletRequest req){
String pathString = CommonInfo.realDir + CommonInfo.productImageRealDir;
String curr = req.getServletContext().getRealPath("/");
return pathString+"======"+curr;
}
@ResponseBody
@RequestMapping(value = "222/test2.do")
public String testPath2(HttpServletRequest req){
String pathString = CommonInfo.realDir + CommonInfo.productImageRealDir;
String curr = req.getServletContext().getRealPath("/");
return pathString+"======"+curr;
}
实际执行效果 一样。