---
title: "如何在Servlet或Action中获取PageContext"
author: "wnzz95391511"
date: "2009-05-21T20:32:04Z"
tags: []
slug: "servlet-action-pagecontext"
draft: false
lastmod: "2009-05-21T20:32:04Z"
id: 393033
url: "https://perfectlife.iteye.com/blog/393033"
---

**如何在Servlet或Action中获取JSP的内置对象PageContext**

```java

javax.servlet.jsp.PageContext pageContext = JspFactory
				.getDefaultFactory().getPageContext(this.getServlet(), request,
						response, null, true, 8192, true);

```