---
title: "在web中常常使用的路径"
author: "mjbb"
date: "2010-03-19T20:39:32Z"
tags: []
categories: ["编程语言"]
slug: "web"
draft: false
lastmod: "2010-03-19T20:39:32Z"
id: 620099
url: "https://mjbb.iteye.com/blog/620099"
---

**
一下用到的都是绝对路径：
// 得到的 basePath 的最后没有'/'
String basePath =request.getSession().getServletContext().getRealPath("/要保存的文件文件地址/");

//在jsp页面中使用
${pageContext.request.contextPath }**