package de.webman.template.jsp;
import javax.servlet.*;
import java.io.*;
import javax.servlet.http.*;
/**
* @author $Author: alex $
* @version $Revision: 1.2 $
*/
public class WebManResponse implements HttpServletResponse
{
private PrintWriter writer;
public WebManResponse(PrintWriter _writer)
{
writer = _writer;
}
/**
* Adds the specified cookie to the response. It can be called
* multiple times to set more than one cookie.
*
* @param cookie the Cookie to return to the client
*/
public void addCookie(Cookie cookie){}
/**
* Checks whether the response message header has a field with
* the specified name.
*
* @param name the header field name
* @return true if the response message header has a field with
* the specified name; false otherwise
*/
public boolean containsHeader(String name)
{
return false;
}
public void addDateHeader(java.lang.String name, long date)
{}
public void addHeader(java.lang.String name, java.lang.String value)
{}
public void addIntHeader(java.lang.String name, int value)
{}
public java.lang.String encodeRedirectURL(java.lang.String url)
{
return url;
}
public java.lang.String encodeURL(java.lang.String url)
{
return url;
}
public void flushBuffer()
{}
/**
2.3
*/
public void resetBuffer()
{
}
public int getBufferSize()
{
return 0;
}
public java.util.Locale getLocale()
{
return null;
}
public boolean isCommitted()
{
return false;
}
public void reset()
{}
public void setBufferSize(int size)
{}
public void setLocale(java.util.Locale loc)
{}
/**
* Sets the status code and message for this response. If the
* field had already been set, the new value overwrites the
* previous one. The message is sent as the body of an HTML
* page, which is returned to the user to describe the problem.
* The page is sent with a default HTML header; the message
* is enclosed in simple body tags (<body></body>).
*
* @param sc the status code
* @param sm the status message
@deprecated
*/
public void setStatus(int sc, String sm){}
/**
* Sets the status code for this response. This method is used to
* set the return status code when there is no error (for example,
* for the status codes SC_OK or SC_MOVED_TEMPORARILY). If there
* is an error, the <code>sendError</code> method should be used
* instead.
*
* @param sc the status code
*
* @see #sendError
@deprecated
*/
public void setStatus(int sc){}
/**
*
* Adds a field to the response header with the given name and value.
* If the field had already been set, the new value overwrites the
* previous one. The <code>containsHeader</code> method can be
* used to test for the presence of a header before setting its
* value.
*
* @param name the name of the header field
* @param value the header field's value
*
* @see #containsHeader
*/
public void setHeader(String name, String value){}
/**
* Adds a field to the response header with the given name and
* integer value. If the field had already been set, the new value
* overwrites the previous one. The <code>containsHeader</code>
* method can be used to test for the presence of a header before
* setting its value.
*
* @param name the name of the header field
* @param value the header field's integer value
*
* @see #containsHeader
*/
public void setIntHeader(String name, int value){}
/**
*
* Adds a field to the response header with the given name and
* date-valued field. The date is specified in terms of
* milliseconds since the epoch. If the date field had already
* been set, the new value overwrites the previous one. The
* <code>containsHeader</code> method can be used to test for the
* presence of a header before setting its value.
*
* @param name the name of the header field
* @param value the header field's date value
*
* @see #containsHeader
*/
public void setDateHeader(String name, long date){}
/**
* Sends an error response to the client using the specified status
* code and descriptive message. If setStatus has previously been
* called, it is reset to the error status code. The message is
* sent as the body of an HTML page, which is returned to the user
* to describe the problem. The page is sent with a default HTML
* header; the message is enclosed in simple body tags
* (<body></body>).
*
* @param sc the status code
* @param msg the detail message
* @exception IOException If an I/O error has occurred. */
public void sendError(int sc, String msg) throws IOException
{
// ausfuellen !!!
}
/**
* Sends an error response to the client using the specified
* status code and a default message.
* @param sc the status code
* @exception IOException If an I/O error has occurred.
*/
public void sendError(int sc) throws IOException
{
// ausfuellen !!!
}
/**
* Sends a temporary redirect response to the client using the
* specified redirect location URL. The URL must be absolute (for
* example, <code><em>https://hostname/path/file.html</em></code>).
* Relative URLs are not permitted here.
*
* @param location the redirect location URL
* @exception IOException If an I/O error has occurred.
*/
public void sendRedirect(String location) throws IOException
{
// brauchen wir
}
/**
* Encodes the specified URL by including the session ID in it,
* or, if encoding is not needed, returns the URL unchanged.
* The implementation of this method should include the logic to
* determine whether the session ID needs to be encoded in the URL.
* For example, if the browser supports cookies, or session
* tracking is turned off, URL encoding is unnecessary.
*
* <p>All URLs emitted by a Servlet should be run through this
* method. Otherwise, URL rewriting cannot be used with browsers
* which do not support cookies.
*
* @param url the url to be encoded.
* @return the encoded URL if encoding is needed; the unchanged URL
* otherwise.
@deprecated
*/
public String encodeUrl (String url){return url;}
/**
* Encodes the specified URL for use in the
* <code>sendRedirect</code> method or, if encoding is not needed,
* returns the URL unchanged. The implementation of this method
* should include the logic to determine whether the session ID
* needs to be encoded in the URL. Because the rules for making
* this determination differ from those used to decide whether to
* encode a normal link, this method is seperate from the
* <code>encodeUrl</code> method.
*
* <p>All URLs sent to the HttpServletResponse.sendRedirect
* method should be run through this method. Otherwise, URL
* rewriting canont be used with browsers which do not support
* cookies.
*
* @param url the url to be encoded.
* @return the encoded URL if encoding is needed; the unchanged URL
* otherwise.
*
* @see #sendRedirect
* @see #encodeUrl
@deprecated
*/
public String encodeRedirectUrl (String url)
{
return url;
}
/**
* Sets the content length for this response.
*
* @param len the content length
*/
public void setContentLength(int len)
{}
/**
* Sets the content type for this response. This type may later
* be implicitly modified by addition of properties such as the MIME
* <em>charset=<value></em> if the service finds it necessary,
* and the appropriate media type property has not been set.
*
* <p>This response property may only be assigned one time. If a
* writer is to be used to write a text response, this method must
* be called before the method <code>getWriter</code>. If an
* output stream will be used to write a response, this method must
* be called before the output stream is used to write response
* data.
*
* @param type the content's MIME type
* @see getOutputStream
* @see getWriter */
public void setContentType(String type)
{}
/**
* Returns an output stream for writing binary response data.
*
* @see getWriter
* @exception IllegalStateException if getWriter has been
* called on this same request.
* @exception IOException if an I/O exception has occurred
*/
public ServletOutputStream getOutputStream() throws IOException
{
// ausfuellen
return null;
}
/**
* Returns a print writer for writing formatted text responses. The
* MIME type of the response will be modified, if necessary, to reflect
* the character encoding used, through the <em>charset=...</em>
* property. This means that the content type must be set before
* calling this method.
*
* @see getOutputStream
* @see setContentType
*
* @exception UnsupportedEncodingException if no such encoding can
* be provided
* @exception IllegalStateException if getOutputStream has been
* called on this same request.
* @exception IOException on other errors.
*/
public PrintWriter getWriter () throws IOException
{
return writer;
}
/**
* Returns the character set encoding used for this MIME body.
* The character encoding is either the one specified in the
* assigned content type, or one which the client understands.
* If no content type has yet been assigned, it is implicitly
* set to <em>text/plain</em>
*/
public String getCharacterEncoding ()
{
return null;
}
}
|