---
title: "获取项目部署路径"
author: "danandyu8013"
date: "2012-09-07T11:15:47Z"
tags: ["actioncontext", "httpservletrequest", "项目部署路径"]
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2012-09-07T11:15:47Z"
id: 1668591
url: "https://danandyu8013.iteye.com/blog/1668591"
---

Action类中代码：

 

 

ActionContext context = ActionContext.getContext();  

   HttpServletRequest request = (HttpServletRequest) context.get(ServletActionContext.HTTP\_REQUEST);  

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