Struts1 获取相对路径的方法:
String upload_filepath =
this.getServlet().getServletContext().getRealPath("/")+"Article_Pic//"+pageName ;
Struts2 获取相对路径的方法:
String upload_filepath =
new File(ServletActionContext.getServletContext().getRealPath("/");
Struts1 获取相对路径的方法:
String upload_filepath =
this.getServlet().getServletContext().getRealPath("/")+"Article_Pic//"+pageName ;
Struts2 获取相对路径的方法:
String upload_filepath =
new File(ServletActionContext.getServletContext().getRealPath("/");