Using the PageContext API, write tag handler code to access the JSP implicit variables and access web application attributes.

A PageContext is an object that provides a context to store references to objects used by the page, encapsulates implementation-dependent features, and provides convenience methods. A JSP page implementation class can use a PageContext to run unmodified in any compliant JSP container while taking advantage of implementation-specific improvements like high performance JspWriters.

The PageContext provides a number of facilities to the page/component author and page implementor, including:

public abstract class JspContext {

	public abstract void setAttribute(String name, Object value);
	public abstract void setAttribute(String name, Object value, int scope);
	public abstract Object getAttribute(String name);
	public abstract Object getAttribute(String name, int scope);
	public abstract Object findAttribute(String name);
	public abstract void removeAttribute(String name);
	public abstract void removeAttribute(String name, int scope);
	public abstract int getAttributesScope(String name);
	public abstract Enumeration getAttributeNamesInScope(int scope);
	public abstract JspWriter getOut();

}
					
public abstract class PageContext extends JspContext {

	public abstract javax.servlet.http.HttpSession getSession();
	public abstract java.lang.Object getPage(); 
	public abstract javax.servlet.ServletRequest getRequest();
	public abstract javax.servlet.ServletResponse getResponse();
	public abstract java.lang.Exception getException();
	public abstract javax.servlet.ServletConfig getServletConfig();
	public abstract javax.servlet.ServletContext getServletContext();

	public abstract void forward(java.lang.String relativeUrlPath)
		throws javax.servlet.ServletException, java.io.IOException;
	public abstract void include(java.lang.String relativeUrlPath)
		throws javax.servlet.ServletException, java.io.IOException;
	public abstract void handlePageException(java.lang.Exception e)
		throws javax.servlet.ServletException, java.io.IOException;

}
					

Professional hosting     Belorussian informational portal         Free SCBCD 1.3 Study Guide     Free SCDJWS 1.4 Study Guide     SCDJWS 1.4 Quiz     Free IBM Certified Associate Developer Study Guide     Free SCJP 5.0 (Tiger) Study Guide     Free Mock Exam Engine     IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide