| 1 | |
package org.webslinger.servlet; |
| 2 | |
|
| 3 | |
import javax.servlet.http.HttpServletResponseWrapper; |
| 4 | |
import javax.servlet.http.HttpServletResponse; |
| 5 | |
|
| 6 | 0 | public class OverrideHttpSessionResponse extends HttpServletResponseWrapper { |
| 7 | |
protected final OverrideHttpSessionRequest request; |
| 8 | |
|
| 9 | |
public OverrideHttpSessionResponse(HttpServletResponse response, OverrideHttpSessionRequest request) { |
| 10 | 307 | super(response); |
| 11 | 307 | this.request = request; |
| 12 | 307 | } |
| 13 | |
|
| 14 | |
public HttpServletResponse getResponse() { |
| 15 | 0 | return (HttpServletResponse) super.getResponse(); |
| 16 | |
} |
| 17 | |
|
| 18 | |
protected OverrideHttpSessionRequest getRequest() { |
| 19 | 82 | return request; |
| 20 | |
} |
| 21 | |
|
| 22 | |
protected HttpSessionId getSessionId() { |
| 23 | 41 | return getRequest().getSessionId(true); |
| 24 | |
} |
| 25 | |
|
| 26 | |
protected HttpSessionIdManager getManager() { |
| 27 | 41 | return getRequest().getManager(); |
| 28 | |
} |
| 29 | |
|
| 30 | |
|
| 31 | |
public String encodeUrl(String path) { |
| 32 | 0 | return getManager().encodeURL(path, getSessionId()); |
| 33 | |
} |
| 34 | |
|
| 35 | |
public String encodeURL(String path) { |
| 36 | 18 | return getManager().encodeURL(path, getSessionId()); |
| 37 | |
} |
| 38 | |
|
| 39 | |
public String encodeRedirectURL(String path) { |
| 40 | 23 | return getManager().encodeRedirectURL(path, getSessionId()); |
| 41 | |
} |
| 42 | |
}; |
| 43 | |
|