@RequestMapping("/index")
public String index(ModelMap modelMap,HttpServletRequest req) throws IOException{
System.out.println(req.getSession().getServletContext().getRealPath("/"));
return "/admin/config/index";
}
我想要的是獲取路徑E:\eclipse-workspace\project001,project001是我的項目名稱
eclipse-workspace是eclipse的項目命名空間
運行上面代碼:
E:\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\project001\
卻打印的是這樣的。
添加回答
舉報
0/150
提交
取消