ITeye博客

获取项目部署路径

danandyu8013 · 2012-09-07 11:15 · JAVA · 编程语言 · actioncontext · httpservletrequest · 项目部署路径 · Markdown

Action类中代码:

 

 

ActionContext context = ActionContext.getContext();  

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

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。