|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectHttpServletResponseWrapper
net.sf.j2ep.UrlRewritingResponseWrapper
public final class UrlRewritingResponseWrapper
A wrapper for the normal HttpServletResponse, based on the content-type either the normal output stream of a wrapped stream will be returned. The wrapped stream can handle rewrite of links found in the source. This class also handles rewriting of the headers Location and Set-Cookie.
| Constructor Summary | |
|---|---|
UrlRewritingResponseWrapper(HttpServletResponse response,
Server server,
java.lang.String ownHostName,
java.lang.String contextPath,
ServerChain serverChain)
Basic constructor. |
|
| Method Summary | |
|---|---|
void |
addHeader(java.lang.String name,
java.lang.String originalValue)
Checks if we have to rewrite the header and if so will rewrite it. |
ServletOutputStream |
getOutputStream()
Based on the value in the content-type header we either return the default stream or our own stream that can rewrite links. |
java.io.PrintWriter |
getWriter()
Based on the value in the content-type header we either return the default writer or our own writer. |
void |
processStream()
Rewrites the output stream to change any links. |
void |
setHeader(java.lang.String name,
java.lang.String originalValue)
Checks if we have to rewrite the header and if so will rewrite it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UrlRewritingResponseWrapper(HttpServletResponse response,
Server server,
java.lang.String ownHostName,
java.lang.String contextPath,
ServerChain serverChain)
throws java.io.IOException
response - The response we are wrappingserver - The server that was matchedownHostName - String we are rewriting servers to
java.io.IOException - When there is a problem with the streams| Method Detail |
|---|
public void addHeader(java.lang.String name,
java.lang.String originalValue)
javax.servlet.http.HttpServletResponse#addHeader(java.lang.String, java.lang.String)
public void setHeader(java.lang.String name,
java.lang.String originalValue)
javax.servlet.http.HttpServletResponse#setHeader(java.lang.String, java.lang.String)
public ServletOutputStream getOutputStream()
throws java.io.IOException
java.io.IOExceptionjavax.servlet.ServletResponse#getOutputStream()
public java.io.PrintWriter getWriter()
throws java.io.IOException
java.io.IOExceptionjavax.servlet.ServletResponse#getWriter()
public void processStream()
throws java.io.IOException
java.io.IOException - Is thrown when there is a problem with the streams
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||