com.filter.ResponseContent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of noCacheFilter Show documentation
Show all versions of noCacheFilter Show documentation
append value at static resources for newest
The newest version!
package com.filter;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import java.io.CharArrayWriter;
import java.io.PrintWriter;
public class ResponseContent extends HttpServletResponseWrapper {
private CharArrayWriter buffer;
private PrintWriter printWriter;
protected ResponseContent(HttpServletResponse response) {
super(response);
buffer = new CharArrayWriter();
response.reset();
}
public PrintWriter getWriter() {
if (printWriter == null)
printWriter = new PrintWriter(buffer);
return printWriter;
}
public String toString() {
return buffer.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy