---
title: " 取JSP，Action中全路径的方法"
author: "xdlvpei"
date: "2010-03-02T14:02:40Z"
tags: ["JSP", "Java"]
categories: ["企业架构"]
slug: "jsp-action"
draft: false
lastmod: "2010-03-02T14:02:40Z"
id: 605688
url: "https://lvpei.iteye.com/blog/605688"
---

取JSP，Action中全路径的方法JSP中：${pageContext.request.contextPath}  
       
利用EL表达式，相当于http://localhost:8080/应用名称Jave类中：

```java
String path = request.getScheme()+"://" + request.getServerName()+ ":"+ request.getServerPort()+ request.getContextPath();
```