servletunit.struts
Class StrutsResponseWrapper

java.lang.Object
  extended byservletunit.struts.StrutsResponseWrapper

public class StrutsResponseWrapper
extends java.lang.Object

A wrapper for the HttpServletResponse class. This is used in CactusStrutsTestCase so that we can retrieve the redirect URL set by the ActionServlet in processing an action. This allows us to use the ActionServlet as a black box, rather than mimic its behavior as was previously the case.


Constructor Summary
StrutsResponseWrapper(HttpServletResponse response)
           
 
Method Summary
 void addCookie(Cookie cookie)
           
 void addDateHeader(java.lang.String name, long date)
           
 void addHeader(java.lang.String name, java.lang.String value)
           
 void addIntHeader(java.lang.String name, int value)
           
 boolean containsHeader(java.lang.String name)
           
 java.lang.String encodeRedirectUrl(java.lang.String url)
           
 java.lang.String encodeRedirectURL(java.lang.String url)
           
 java.lang.String encodeUrl(java.lang.String url)
           
 java.lang.String encodeURL(java.lang.String url)
           
 void flushBuffer()
           
 int getBufferSize()
           
 java.lang.String getCharacterEncoding()
           
 java.util.Locale getLocale()
           
 ServletOutputStream getOutputStream()
           
 java.lang.String getRedirectLocation()
           
 java.io.PrintWriter getWriter()
           
 boolean isCommitted()
           
 void reset()
           
 void resetBuffer()
           
 void sendError(int sc)
           
 void sendError(int sc, java.lang.String msg)
           
 void sendRedirect(java.lang.String location)
           
 void setBufferSize(int size)
           
 void setContentLength(int len)
           
 void setContentType(java.lang.String type)
           
 void setDateHeader(java.lang.String name, long date)
           
 void setHeader(java.lang.String name, java.lang.String value)
           
 void setIntHeader(java.lang.String name, int value)
           
 void setLocale(java.util.Locale loc)
           
 void setStatus(int sc)
           
 void setStatus(int sc, java.lang.String sm)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrutsResponseWrapper

public StrutsResponseWrapper(HttpServletResponse response)
Method Detail

addCookie

public void addCookie(Cookie cookie)

addDateHeader

public void addDateHeader(java.lang.String name,
                          long date)

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String value)

addIntHeader

public void addIntHeader(java.lang.String name,
                         int value)

containsHeader

public boolean containsHeader(java.lang.String name)

encodeRedirectUrl

public java.lang.String encodeRedirectUrl(java.lang.String url)

encodeRedirectURL

public java.lang.String encodeRedirectURL(java.lang.String url)

encodeUrl

public java.lang.String encodeUrl(java.lang.String url)

encodeURL

public java.lang.String encodeURL(java.lang.String url)

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Throws:
java.io.IOException

getBufferSize

public int getBufferSize()

getCharacterEncoding

public java.lang.String getCharacterEncoding()

getLocale

public java.util.Locale getLocale()

getOutputStream

public ServletOutputStream getOutputStream()
                                    throws java.io.IOException
Throws:
java.io.IOException

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.IOException
Throws:
java.io.IOException

isCommitted

public boolean isCommitted()

reset

public void reset()

resetBuffer

public void resetBuffer()

sendError

public void sendError(int sc)
               throws java.io.IOException
Throws:
java.io.IOException

sendError

public void sendError(int sc,
                      java.lang.String msg)
               throws java.io.IOException
Throws:
java.io.IOException

sendRedirect

public void sendRedirect(java.lang.String location)
                  throws java.io.IOException
Throws:
java.io.IOException

setBufferSize

public void setBufferSize(int size)

setContentLength

public void setContentLength(int len)

setContentType

public void setContentType(java.lang.String type)

setDateHeader

public void setDateHeader(java.lang.String name,
                          long date)

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)

setIntHeader

public void setIntHeader(java.lang.String name,
                         int value)

setStatus

public void setStatus(int sc)

setStatus

public void setStatus(int sc,
                      java.lang.String sm)

setLocale

public void setLocale(java.util.Locale loc)

getRedirectLocation

public java.lang.String getRedirectLocation()


Copyright Deryl Seale All Rights Reserved.