---
title: "java中获得系统路径"
author: "fanjava"
date: "2004-11-15T19:06:00Z"
tags: []
slug: "java"
draft: false
lastmod: "2004-11-15T19:06:00Z"
id: 601812
url: "https://fanjava.iteye.com/blog/601812"
---

在Application中:  
System.getProperty("user.dir")  
在Servlet中:  
ServletContext servletContext = config.getServletContext();  
String rootPath = servletContext.getRealPath("/");  
在jsp中:  
application.getRealPath("")