org.springframework.extensions.surf.util
Class FakeJspPageContext

java.lang.Object
  extended by javax.servlet.jsp.JspContext
      extended by javax.servlet.jsp.PageContext
          extended by org.springframework.extensions.surf.util.FakeJspPageContext

public class FakeJspPageContext
extends javax.servlet.jsp.PageContext

Fake Jsp PageContext implementation which wraps predescribed HTTP objects.

Author:
muzquiano

Field Summary
protected  javax.servlet.ServletContext context
          The context.
protected  Exception exception
          The exception.
protected  javax.servlet.jsp.JspWriter out
          The out.
protected  javax.servlet.http.HttpServletRequest request
          The request.
protected  javax.servlet.http.HttpServletResponse response
          The response.
protected  Map<String,Object> values
          The values.
 
Fields inherited from class javax.servlet.jsp.PageContext
APPLICATION, APPLICATION_SCOPE, CONFIG, EXCEPTION, OUT, PAGE, PAGE_SCOPE, PAGECONTEXT, REQUEST, REQUEST_SCOPE, RESPONSE, SESSION, SESSION_SCOPE
 
Constructor Summary
FakeJspPageContext(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.jsp.JspWriter out)
          Instantiates a new fake jsp page context
 
Method Summary
 Object findAttribute(String name)
           
 void flushOut()
          Flush out.
 void forward(String url)
           
 Object getAttribute(String name)
           
 Object getAttribute(String name, int scope)
           
 Enumeration getAttributeNamesInScope(int scope)
           
 int getAttributesScope(String name)
           
 Exception getException()
           
 javax.servlet.jsp.el.ExpressionEvaluator getExpressionEvaluator()
           
 javax.servlet.jsp.JspWriter getOut()
           
 Object getPage()
           
 javax.servlet.ServletRequest getRequest()
           
 javax.servlet.ServletResponse getResponse()
           
 javax.servlet.ServletConfig getServletConfig()
           
 javax.servlet.ServletContext getServletContext()
           
 javax.servlet.http.HttpSession getSession()
           
protected  Object getValue(String key)
          Gets the value.
protected  Enumeration getValueNames()
          Gets the value names.
 javax.servlet.jsp.el.VariableResolver getVariableResolver()
           
 void handlePageException(Exception e)
           
 void handlePageException(Throwable t)
           
 void include(String url)
           
 void include(String url, boolean b)
           
 void initialize(javax.servlet.Servlet srv, javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, String s1, boolean b1, int i1, boolean b2)
           
 void release()
           
 void removeAttribute(String name)
           
 void removeAttribute(String name, int scope)
           
protected  void removeValue(String key)
          Removes the value.
 void setAttribute(String name, Object obj)
           
 void setAttribute(String name, Object obj, int scope)
           
protected  void setValue(String key, Object value)
          Sets the value.
 
Methods inherited from class javax.servlet.jsp.PageContext
getErrorData, pushBody
 
Methods inherited from class javax.servlet.jsp.JspContext
getELContext, popBody, pushBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exception

protected Exception exception
The exception.


values

protected Map<String,Object> values
The values.


context

protected javax.servlet.ServletContext context
The context.


request

protected javax.servlet.http.HttpServletRequest request
The request.


response

protected javax.servlet.http.HttpServletResponse response
The response.


out

protected javax.servlet.jsp.JspWriter out
The out.

Constructor Detail

FakeJspPageContext

public FakeJspPageContext(javax.servlet.ServletContext context,
                          javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response,
                          javax.servlet.jsp.JspWriter out)
Instantiates a new fake jsp page context

Parameters:
context - The ServletContext to wrap
request - The HttpServletRequest instance to wrap
response - The HttpServletResponse instance to wrap
out - The JspWriter to wrap
Method Detail

getRequest

public javax.servlet.ServletRequest getRequest()
Specified by:
getRequest in class javax.servlet.jsp.PageContext

getResponse

public javax.servlet.ServletResponse getResponse()
Specified by:
getResponse in class javax.servlet.jsp.PageContext

getServletContext

public javax.servlet.ServletContext getServletContext()
Specified by:
getServletContext in class javax.servlet.jsp.PageContext

getServletConfig

public javax.servlet.ServletConfig getServletConfig()
Specified by:
getServletConfig in class javax.servlet.jsp.PageContext

getOut

public javax.servlet.jsp.JspWriter getOut()
Specified by:
getOut in class javax.servlet.jsp.JspContext

getSession

public javax.servlet.http.HttpSession getSession()
Specified by:
getSession in class javax.servlet.jsp.PageContext

findAttribute

public Object findAttribute(String name)
Specified by:
findAttribute in class javax.servlet.jsp.JspContext

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in class javax.servlet.jsp.JspContext

getAttribute

public Object getAttribute(String name,
                           int scope)
Specified by:
getAttribute in class javax.servlet.jsp.JspContext

setAttribute

public void setAttribute(String name,
                         Object obj)
Specified by:
setAttribute in class javax.servlet.jsp.JspContext

setAttribute

public void setAttribute(String name,
                         Object obj,
                         int scope)
Specified by:
setAttribute in class javax.servlet.jsp.JspContext

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in class javax.servlet.jsp.JspContext

removeAttribute

public void removeAttribute(String name,
                            int scope)
Specified by:
removeAttribute in class javax.servlet.jsp.JspContext

getAttributeNamesInScope

public Enumeration getAttributeNamesInScope(int scope)
Specified by:
getAttributeNamesInScope in class javax.servlet.jsp.JspContext

getAttributesScope

public int getAttributesScope(String name)
Specified by:
getAttributesScope in class javax.servlet.jsp.JspContext

forward

public void forward(String url)
             throws javax.servlet.ServletException,
                    IOException
Specified by:
forward in class javax.servlet.jsp.PageContext
Throws:
javax.servlet.ServletException
IOException

include

public void include(String url)
             throws javax.servlet.ServletException,
                    IOException
Specified by:
include in class javax.servlet.jsp.PageContext
Throws:
javax.servlet.ServletException
IOException

include

public void include(String url,
                    boolean b)
             throws javax.servlet.ServletException,
                    IOException
Specified by:
include in class javax.servlet.jsp.PageContext
Throws:
javax.servlet.ServletException
IOException

flushOut

public void flushOut()
              throws IOException
Flush out.

Throws:
IOException - Signals that an I/O exception has occurred.

release

public void release()
Specified by:
release in class javax.servlet.jsp.PageContext

getExpressionEvaluator

public javax.servlet.jsp.el.ExpressionEvaluator getExpressionEvaluator()
Specified by:
getExpressionEvaluator in class javax.servlet.jsp.JspContext

getVariableResolver

public javax.servlet.jsp.el.VariableResolver getVariableResolver()
Specified by:
getVariableResolver in class javax.servlet.jsp.JspContext

handlePageException

public void handlePageException(Throwable t)
Specified by:
handlePageException in class javax.servlet.jsp.PageContext

handlePageException

public void handlePageException(Exception e)
Specified by:
handlePageException in class javax.servlet.jsp.PageContext

getException

public Exception getException()
Specified by:
getException in class javax.servlet.jsp.PageContext

getPage

public Object getPage()
Specified by:
getPage in class javax.servlet.jsp.PageContext

initialize

public void initialize(javax.servlet.Servlet srv,
                       javax.servlet.ServletRequest req,
                       javax.servlet.ServletResponse res,
                       String s1,
                       boolean b1,
                       int i1,
                       boolean b2)
Specified by:
initialize in class javax.servlet.jsp.PageContext

getValue

protected Object getValue(String key)
Gets the value.

Parameters:
key - the key
Returns:
the value

setValue

protected void setValue(String key,
                        Object value)
Sets the value.

Parameters:
key - the key
value - the value

removeValue

protected void removeValue(String key)
Removes the value.

Parameters:
key - the key

getValueNames

protected Enumeration getValueNames()
Gets the value names.

Returns:
the value names


Copyright © 2009 SpringSource, Inc. All Rights Reserved.