01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.http;
16:
17: import java.io.IOException;
18: import java.io.OutputStream;
19: import java.io.PrintWriter;
20: import java.util.Locale;
21: import javax.servlet.http.HttpServletResponse;
22: import org.araneaframework.OutputData;
23:
24: /**
25: * Provides methods to deal with the manipulate low-level HTTP constructs. Wraps the {@link HttpServletResponse}.
26: *
27: * @author Jevgeni Kabanov (ekabanov@webmedia.ee)
28: *
29: * @see HttpInputData
30: */
31: public interface HttpOutputData extends OutputData {
32: /**
33: * Encodes the URL to include some additional information (e.g. HTTP session identifier).
34: * Note that Aranea may include some information not present in the servlet spec.
35: */
36: String encodeURL(String url);
37:
38: /**
39: * Sends an HTTP redirect to a specified location URL.
40: */
41: void sendRedirect(String location) throws IOException;
42:
43: /**
44: * Returns an <code>OutputStream</code> that can be used to write to response.
45: * Note that unlike the Servlet specification, Aranea permits to use stream and writer interchangeably.
46: */
47: OutputStream getOutputStream() throws IOException;
48:
49: /**
50: * Returns a <code>PrintWriter</code> that can be used to write to response.
51: * Note that unlike the Servlet specification, Aranea permits to use stream and writer interchangeably.
52: */
53: PrintWriter getWriter() throws IOException;
54:
55: /**
56: * Sets the MIME content type of the output. May include the charset, e.g. "text/html; charset=UTF-8".
57: */
58: void setContentType(String type);
59:
60: /**
61: * Returns the character encoding used to write out the response.
62: */
63: String getCharacterEncoding();
64:
65: /**
66: * Sets the character encoding used to write out the response.
67: */
68: void setCharacterEncoding(String encoding);
69:
70: /**
71: * Returns the locale associated with the response.
72: */
73: Locale getLocale();
74: }
|