public class MockBodyContent
extends javax.servlet.jsp.tagext.BodyContent
BodyContent class.
Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.
| Constructor and Description |
|---|
MockBodyContent(String content,
javax.servlet.http.HttpServletResponse response)
Create a MockBodyContent for the given response.
|
MockBodyContent(String content,
javax.servlet.http.HttpServletResponse response,
Writer targetWriter)
Create a MockBodyContent for the given response.
|
MockBodyContent(String content,
Writer targetWriter)
Create a MockBodyContent for the given response.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
clearBuffer() |
void |
close() |
Reader |
getReader() |
int |
getRemaining() |
String |
getString() |
void |
newLine() |
void |
print(boolean value) |
void |
print(char value) |
void |
print(char[] value) |
void |
print(double value) |
void |
print(float value) |
void |
print(int value) |
void |
print(long value) |
void |
print(Object value) |
void |
print(String value) |
void |
println() |
void |
println(boolean value) |
void |
println(char value) |
void |
println(char[] value) |
void |
println(double value) |
void |
println(float value) |
void |
println(int value) |
void |
println(long value) |
void |
println(Object value) |
void |
println(String value) |
void |
write(char[] value,
int offset,
int length) |
void |
writeOut(Writer writer) |
public MockBodyContent(String content, javax.servlet.http.HttpServletResponse response)
content - the body content to exposeresponse - the servlet response to wrappublic MockBodyContent(String content, Writer targetWriter)
content - the body content to exposetargetWriter - the target Writer to wrappublic MockBodyContent(String content, javax.servlet.http.HttpServletResponse response, Writer targetWriter)
content - the body content to exposeresponse - the servlet response to wraptargetWriter - the target Writer to wrappublic Reader getReader()
getReader in class javax.servlet.jsp.tagext.BodyContentpublic String getString()
getString in class javax.servlet.jsp.tagext.BodyContentpublic void writeOut(Writer writer) throws IOException
writeOut in class javax.servlet.jsp.tagext.BodyContentIOExceptionpublic void clear()
throws IOException
clear in class javax.servlet.jsp.JspWriterIOExceptionpublic void clearBuffer()
throws IOException
clearBuffer in class javax.servlet.jsp.JspWriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class javax.servlet.jsp.JspWriterIOExceptionpublic int getRemaining()
getRemaining in class javax.servlet.jsp.JspWriterpublic void newLine()
throws IOException
newLine in class javax.servlet.jsp.JspWriterIOExceptionpublic void write(char[] value,
int offset,
int length)
throws IOException
write in class WriterIOExceptionpublic void print(boolean value)
throws IOException
print in class javax.servlet.jsp.JspWriterIOExceptionpublic void print(char value)
throws IOException
print in class javax.servlet.jsp.JspWriterIOExceptionpublic void print(char[] value)
throws IOException
print in class javax.servlet.jsp.JspWriterIOExceptionpublic void print(double value)
throws IOException
print in class javax.servlet.jsp.JspWriterIOExceptionpublic void print(float value)
throws IOException
print in class javax.servlet.jsp.JspWriterIOExceptionpublic void print(int value)
throws IOException
print in class javax.servlet.jsp.JspWriterIOExceptionpublic void print(long value)
throws IOException
print in class javax.servlet.jsp.JspWriterIOExceptionpublic void print(Object value) throws IOException
print in class javax.servlet.jsp.JspWriterIOExceptionpublic void print(String value) throws IOException
print in class javax.servlet.jsp.JspWriterIOExceptionpublic void println()
throws IOException
println in class javax.servlet.jsp.JspWriterIOExceptionpublic void println(boolean value)
throws IOException
println in class javax.servlet.jsp.JspWriterIOExceptionpublic void println(char value)
throws IOException
println in class javax.servlet.jsp.JspWriterIOExceptionpublic void println(char[] value)
throws IOException
println in class javax.servlet.jsp.JspWriterIOExceptionpublic void println(double value)
throws IOException
println in class javax.servlet.jsp.JspWriterIOExceptionpublic void println(float value)
throws IOException
println in class javax.servlet.jsp.JspWriterIOExceptionpublic void println(int value)
throws IOException
println in class javax.servlet.jsp.JspWriterIOExceptionpublic void println(long value)
throws IOException
println in class javax.servlet.jsp.JspWriterIOExceptionpublic void println(Object value) throws IOException
println in class javax.servlet.jsp.JspWriterIOExceptionpublic void println(String value) throws IOException
println in class javax.servlet.jsp.JspWriterIOExceptionCopyright © 2015. All rights reserved.