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
_logger
private Redirector
_redirect
private 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:
addHeader
in interfaceHttpServletResponse
-
addDateHeader
public void addDateHeader(String name, long date)
- Specified by:
addDateHeader
in interfaceHttpServletResponse
-
setIntHeader
public void setIntHeader(String name, int value)
- Specified by:
setIntHeader
in interfaceHttpServletResponse
-
setDateHeader
public void setDateHeader(String name, long date)
- Specified by:
setDateHeader
in interfaceHttpServletResponse
-
getHeader
public String getHeader(String name)
- Specified by:
getHeader
in interfaceHttpServletResponse
-
getHeaders
public Collection<String> getHeaders(String name)
- Specified by:
getHeaders
in interfaceHttpServletResponse
-
getHeaderNames
public Collection<String> getHeaderNames()
- Specified by:
getHeaderNames
in interfaceHttpServletResponse
-
setContentType
public void setContentType(String type)
- Specified by:
setContentType
in interfaceServletResponse
-
encodeURL
public String encodeURL(String url)
- Specified by:
encodeURL
in interfaceHttpServletResponse
-
encodeUrl
@Deprecated public String encodeUrl(String url)
Deprecated.- Specified by:
encodeUrl
in interfaceHttpServletResponse
-
encodeRedirectURL
public String encodeRedirectURL(String url)
- Specified by:
encodeRedirectURL
in interfaceHttpServletResponse
-
encodeRedirectUrl
@Deprecated public String encodeRedirectUrl(String url)
Deprecated.- Specified by:
encodeRedirectUrl
in interfaceHttpServletResponse
-
getCharacterEncoding
public String getCharacterEncoding()
- Specified by:
getCharacterEncoding
in interfaceServletResponse
-
setContentLength
public void setContentLength(int length)
- Specified by:
setContentLength
in interfaceServletResponse
-
setContentLengthLong
public void setContentLengthLong(long len)
- Specified by:
setContentLengthLong
in interfaceServletResponse
-
isCommitted
public boolean isCommitted()
- Specified by:
isCommitted
in interfaceServletResponse
-
getOutputStream
public ServletOutputStream getOutputStream() throws IOException
- Specified by:
getOutputStream
in interfaceServletResponse
- Throws:
IOException
-
setStatus
public void setStatus(int sc)
- Specified by:
setStatus
in interfaceHttpServletResponse
-
setStatus
@Deprecated public void setStatus(int sc, String sm)
Deprecated.- Specified by:
setStatus
in interfaceHttpServletResponse
-
getStatus
public int getStatus()
- Specified by:
getStatus
in interfaceHttpServletResponse
-
reset
public void reset()
- Specified by:
reset
in interfaceServletResponse
-
getBufferSize
public int getBufferSize()
- Specified by:
getBufferSize
in interfaceServletResponse
-
flushBuffer
public void flushBuffer() throws IOException
- Specified by:
flushBuffer
in interfaceServletResponse
- Throws:
IOException
-
setBufferSize
public void setBufferSize(int size)
- Specified by:
setBufferSize
in interfaceServletResponse
-
sendRedirect
public void sendRedirect(String location) throws IOException
- Specified by:
sendRedirect
in interfaceHttpServletResponse
- Throws:
IOException
-
setHeader
public void setHeader(String name, String value)
- Specified by:
setHeader
in interfaceHttpServletResponse
-
getLocale
public Locale getLocale()
- Specified by:
getLocale
in interfaceServletResponse
-
setLocale
public void setLocale(Locale loc)
- Specified by:
setLocale
in interfaceServletResponse
-
sendError
public void sendError(int sc) throws IOException
- Specified by:
sendError
in interfaceHttpServletResponse
- Throws:
IOException
-
sendError
public void sendError(int sc, String sm) throws IOException
- Specified by:
sendError
in interfaceHttpServletResponse
- Throws:
IOException
-
containsHeader
public boolean containsHeader(String name)
- Specified by:
containsHeader
in interfaceHttpServletResponse
-
addIntHeader
public void addIntHeader(String name, int value)
- Specified by:
addIntHeader
in interfaceHttpServletResponse
-
getWriter
public PrintWriter getWriter() throws IOException
- Specified by:
getWriter
in interfaceServletResponse
- Throws:
IOException
-
addCookie
public void addCookie(Cookie cookie)
- Specified by:
addCookie
in interfaceHttpServletResponse
-
getContentType
public String getContentType()
- Specified by:
getContentType
in interfaceServletResponse
-
resetBuffer
public void resetBuffer()
- Specified by:
resetBuffer
in interfaceServletResponse
-
setCharacterEncoding
public void setCharacterEncoding(String arg0)
- Specified by:
setCharacterEncoding
in interfaceServletResponse
-
-