Methods Summary |
---|
public void | addDateHeader(java.lang.String name, long value)
super.addDateHeader(name, value);
String lname = name.toLowerCase();
if (lname.equals(LAST_MODIFIED)) {
lastModified = value;
}
|
public void | addHeader(java.lang.String name, java.lang.String value)
super.addHeader(name, value);
String lname = name.toLowerCase();
if (lname.equals(LAST_MODIFIED)) {
try {
lastModified = DateTool.rfc1123Format.parse(value).getTime();
} catch (Throwable ignore) { }
} else if (lname.equals(CONTENT_TYPE)) {
contentType = value;
}
|
public void | flushOutputStreamOrWriter()Flush the servletOutputStream or printWriter ( only one will be non-null )
This must be called after a requestDispatcher.include, since we can't
assume that the included servlet flushed its stream.
if (servletOutputStream != null) {
servletOutputStream.flush();
}
if (printWriter != null) {
printWriter.flush();
}
|
public java.lang.String | getContentType()Returns the value of the content-type header field.
if (contentType == null) {
String url = request.getRequestURI();
String mime = context.getMimeType(url);
if (mime != null)
{
setContentType(mime);
}
else
{
// return a safe value
setContentType("application/x-octet-stream");
}
}
return contentType;
|
public long | getLastModified()Returns the value of the last-modified header field. The
result is the number of milliseconds since January 1, 1970 GMT.
if (lastModified == -1) {
// javadocs say to return -1 if date not known, if you want another
// default, put it here
return -1;
}
return lastModified;
|
public javax.servlet.ServletOutputStream | getOutputStream()Return a OutputStream, throws and exception if a printwriter already
been returned.
if (printWriter == null) {
if (servletOutputStream == null) {
servletOutputStream = captureServletOutputStream;
}
return servletOutputStream;
}
throw new IllegalStateException();
|
public java.io.PrintWriter | getWriter()Return a printwriter, throws and exception if a OutputStream already
been returned.
if (servletOutputStream == null) {
if (printWriter == null) {
setCharacterEncoding(getCharacterEncoding());
printWriter = new PrintWriter(
new OutputStreamWriter(captureServletOutputStream,
getCharacterEncoding()));
}
return printWriter;
}
throw new IllegalStateException();
|
public void | setContentType(java.lang.String mime)Sets the value of the content-type header field.
contentType = mime;
if (contentType != null) {
getResponse().setContentType(contentType);
}
|
public void | setDateHeader(java.lang.String name, long value)
super.setDateHeader(name, value);
String lname = name.toLowerCase();
if (lname.equals(LAST_MODIFIED)) {
lastModified = value;
}
|
public void | setHeader(java.lang.String name, java.lang.String value)
super.setHeader(name, value);
String lname = name.toLowerCase();
if (lname.equals(LAST_MODIFIED)) {
try {
lastModified = DateTool.rfc1123Format.parse(value).getTime();
} catch (Throwable ignore) { }
}
else if (lname.equals(CONTENT_TYPE))
{
contentType = value;
}
|
public void | setLastModified(long lastModified)Sets the value of the last-modified header field.
this.lastModified = lastModified;
((HttpServletResponse) getResponse()).setDateHeader(LAST_MODIFIED,
lastModified);
|