获取项目部署路径

 

Action类中代码:

 

 

ActionContext context = ActionContext.getContext();  

   HttpServletRequest request = (HttpServletRequest) context.get(ServletActionContext.HTTP_REQUEST);  

   String path=request.getSession().getServletContext().getRealPath("");

 

 

 

你可能感兴趣的:(项目部署路径,ActionContext)