Class ServletWrapperResponse
- java.lang.Object
 - 
- org.ametys.core.servletwrapper.servlet.ServletWrapperResponse
 
 
- 
- All Implemented Interfaces:
 HttpServletResponse,ServletResponse
public class ServletWrapperResponse extends Object implements HttpServletResponse
This class is a filter for the communication between Tomcat and Cocoon. This one concerns the response request. All the methods of the HttpServletResponse interface are implemented.
Only one of them will be usefull : sendRedirect(). This method uses the cocoon redirector to send the request. 
- 
- 
Field Summary
Fields Modifier and Type Field Description private org.slf4j.Logger_loggerprivate Redirector_redirectprivate HttpServletResponse_response- 
Fields inherited from interface javax.servlet.http.HttpServletResponse
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY 
 - 
 
- 
Constructor Summary
Constructors Constructor Description ServletWrapperResponse(HttpServletResponse req, Redirector redirect)Constructor of this filter. 
- 
Method Summary
 
 - 
 
- 
- 
Field Detail
- 
_response
private HttpServletResponse _response
 
- 
_redirect
private Redirector _redirect
 
- 
_logger
private org.slf4j.Logger _logger
 
 - 
 
- 
Constructor Detail
- 
ServletWrapperResponse
public ServletWrapperResponse(HttpServletResponse req, Redirector redirect)
Constructor of this filter.- Parameters:
 req- the response Httpservletredirect- the Cocoon redirector.
 
 - 
 
- 
Method Detail
- 
addHeader
public void addHeader(String name, String value)
- Specified by:
 addHeaderin interfaceHttpServletResponse
 
- 
addDateHeader
public void addDateHeader(String name, long date)
- Specified by:
 addDateHeaderin interfaceHttpServletResponse
 
- 
setIntHeader
public void setIntHeader(String name, int value)
- Specified by:
 setIntHeaderin interfaceHttpServletResponse
 
- 
setDateHeader
public void setDateHeader(String name, long date)
- Specified by:
 setDateHeaderin interfaceHttpServletResponse
 
- 
getHeader
public String getHeader(String name)
- Specified by:
 getHeaderin interfaceHttpServletResponse
 
- 
getHeaders
public Collection<String> getHeaders(String name)
- Specified by:
 getHeadersin interfaceHttpServletResponse
 
- 
getHeaderNames
public Collection<String> getHeaderNames()
- Specified by:
 getHeaderNamesin interfaceHttpServletResponse
 
- 
setContentType
public void setContentType(String type)
- Specified by:
 setContentTypein interfaceServletResponse
 
- 
encodeURL
public String encodeURL(String url)
- Specified by:
 encodeURLin interfaceHttpServletResponse
 
- 
encodeUrl
@Deprecated public String encodeUrl(String url)
Deprecated.- Specified by:
 encodeUrlin interfaceHttpServletResponse
 
- 
encodeRedirectURL
public String encodeRedirectURL(String url)
- Specified by:
 encodeRedirectURLin interfaceHttpServletResponse
 
- 
encodeRedirectUrl
@Deprecated public String encodeRedirectUrl(String url)
Deprecated.- Specified by:
 encodeRedirectUrlin interfaceHttpServletResponse
 
- 
getCharacterEncoding
public String getCharacterEncoding()
- Specified by:
 getCharacterEncodingin interfaceServletResponse
 
- 
setContentLength
public void setContentLength(int length)
- Specified by:
 setContentLengthin interfaceServletResponse
 
- 
setContentLengthLong
public void setContentLengthLong(long len)
- Specified by:
 setContentLengthLongin interfaceServletResponse
 
- 
isCommitted
public boolean isCommitted()
- Specified by:
 isCommittedin interfaceServletResponse
 
- 
getOutputStream
public ServletOutputStream getOutputStream() throws IOException
- Specified by:
 getOutputStreamin interfaceServletResponse- Throws:
 IOException
 
- 
setStatus
public void setStatus(int sc)
- Specified by:
 setStatusin interfaceHttpServletResponse
 
- 
setStatus
@Deprecated public void setStatus(int sc, String sm)
Deprecated.- Specified by:
 setStatusin interfaceHttpServletResponse
 
- 
getStatus
public int getStatus()
- Specified by:
 getStatusin interfaceHttpServletResponse
 
- 
reset
public void reset()
- Specified by:
 resetin interfaceServletResponse
 
- 
getBufferSize
public int getBufferSize()
- Specified by:
 getBufferSizein interfaceServletResponse
 
- 
flushBuffer
public void flushBuffer() throws IOException
- Specified by:
 flushBufferin interfaceServletResponse- Throws:
 IOException
 
- 
setBufferSize
public void setBufferSize(int size)
- Specified by:
 setBufferSizein interfaceServletResponse
 
- 
sendRedirect
public void sendRedirect(String location) throws IOException
- Specified by:
 sendRedirectin interfaceHttpServletResponse- Throws:
 IOException
 
- 
setHeader
public void setHeader(String name, String value)
- Specified by:
 setHeaderin interfaceHttpServletResponse
 
- 
getLocale
public Locale getLocale()
- Specified by:
 getLocalein interfaceServletResponse
 
- 
setLocale
public void setLocale(Locale loc)
- Specified by:
 setLocalein interfaceServletResponse
 
- 
sendError
public void sendError(int sc) throws IOException
- Specified by:
 sendErrorin interfaceHttpServletResponse- Throws:
 IOException
 
- 
sendError
public void sendError(int sc, String sm) throws IOException
- Specified by:
 sendErrorin interfaceHttpServletResponse- Throws:
 IOException
 
- 
containsHeader
public boolean containsHeader(String name)
- Specified by:
 containsHeaderin interfaceHttpServletResponse
 
- 
addIntHeader
public void addIntHeader(String name, int value)
- Specified by:
 addIntHeaderin interfaceHttpServletResponse
 
- 
getWriter
public PrintWriter getWriter() throws IOException
- Specified by:
 getWriterin interfaceServletResponse- Throws:
 IOException
 
- 
addCookie
public void addCookie(Cookie cookie)
- Specified by:
 addCookiein interfaceHttpServletResponse
 
- 
getContentType
public String getContentType()
- Specified by:
 getContentTypein interfaceServletResponse
 
- 
resetBuffer
public void resetBuffer()
- Specified by:
 resetBufferin interfaceServletResponse
 
- 
setCharacterEncoding
public void setCharacterEncoding(String arg0)
- Specified by:
 setCharacterEncodingin interfaceServletResponse
 
 - 
 
 -