Package org.springframework.mock.web
Class MockJspWriter
java.lang.Object
java.io.Writer
jakarta.servlet.jsp.JspWriter
org.springframework.mock.web.MockJspWriter
- All Implemented Interfaces:
- Closeable,- Flushable,- Appendable,- AutoCloseable
Mock implementation of the 
JspWriter class.
 Only necessary for testing applications when testing custom JSP tags.- Since:
- 2.5
- Author:
- Juergen Hoeller
- 
Field SummaryFields inherited from class jakarta.servlet.jsp.JspWriterautoFlush, bufferSize, DEFAULT_BUFFER, NO_BUFFER, UNBOUNDED_BUFFER
- 
Constructor SummaryConstructorsConstructorDescriptionMockJspWriter(HttpServletResponse response) Create a MockJspWriter for the given response, using the response's default Writer.MockJspWriter(HttpServletResponse response, Writer targetWriter) Create a MockJspWriter for the given response.MockJspWriter(Writer targetWriter) Create a MockJspWriter for the given plain Writer.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()voidvoidclose()voidflush()intprotected PrintWriterLazily initialize the target Writer.voidnewLine()voidprint(boolean value) voidprint(char value) voidprint(char[] value) voidprint(double value) voidprint(float value) voidprint(int value) voidprint(long value) voidvoidvoidprintln()voidprintln(boolean value) voidprintln(char value) voidprintln(char[] value) voidprintln(double value) voidprintln(float value) voidprintln(int value) voidprintln(long value) voidvoidvoidwrite(char[] value, int offset, int length) Methods inherited from class jakarta.servlet.jsp.JspWritergetBufferSize, isAutoFlush
- 
Constructor Details- 
MockJspWriterCreate a MockJspWriter for the given response, using the response's default Writer.- Parameters:
- response- the servlet response to wrap
 
- 
MockJspWriterCreate a MockJspWriter for the given plain Writer.- Parameters:
- targetWriter- the target Writer to wrap
 
- 
MockJspWriterCreate a MockJspWriter for the given response.- Parameters:
- response- the servlet response to wrap
- targetWriter- the target Writer to wrap
 
 
- 
- 
Method Details- 
getTargetWriterLazily initialize the target Writer.- Throws:
- IOException
 
- 
clear- Specified by:
- clearin class- JspWriter
- Throws:
- IOException
 
- 
clearBuffer- Specified by:
- clearBufferin class- JspWriter
- Throws:
- IOException
 
- 
flush- Specified by:
- flushin interface- Flushable
- Specified by:
- flushin class- JspWriter
- Throws:
- IOException
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein class- JspWriter
- Throws:
- IOException
 
- 
getRemainingpublic int getRemaining()- Specified by:
- getRemainingin class- JspWriter
 
- 
newLine- Specified by:
- newLinein class- JspWriter
- Throws:
- IOException
 
- 
write- Specified by:
- writein class- Writer
- Throws:
- IOException
 
- 
print- Specified by:
- printin class- JspWriter
- Throws:
- IOException
 
- 
print- Specified by:
- printin class- JspWriter
- Throws:
- IOException
 
- 
print- Specified by:
- printin class- JspWriter
- Throws:
- IOException
 
- 
print- Specified by:
- printin class- JspWriter
- Throws:
- IOException
 
- 
print- Specified by:
- printin class- JspWriter
- Throws:
- IOException
 
- 
print- Specified by:
- printin class- JspWriter
- Throws:
- IOException
 
- 
print- Specified by:
- printin class- JspWriter
- Throws:
- IOException
 
- 
print- Specified by:
- printin class- JspWriter
- Throws:
- IOException
 
- 
print- Specified by:
- printin class- JspWriter
- Throws:
- IOException
 
- 
println- Specified by:
- printlnin class- JspWriter
- Throws:
- IOException
 
- 
println- Specified by:
- printlnin class- JspWriter
- Throws:
- IOException
 
- 
println- Specified by:
- printlnin class- JspWriter
- Throws:
- IOException
 
- 
println- Specified by:
- printlnin class- JspWriter
- Throws:
- IOException
 
- 
println- Specified by:
- printlnin class- JspWriter
- Throws:
- IOException
 
- 
println- Specified by:
- printlnin class- JspWriter
- Throws:
- IOException
 
- 
println- Specified by:
- printlnin class- JspWriter
- Throws:
- IOException
 
- 
println- Specified by:
- printlnin class- JspWriter
- Throws:
- IOException
 
- 
println- Specified by:
- printlnin class- JspWriter
- Throws:
- IOException
 
- 
println- Specified by:
- printlnin class- JspWriter
- Throws:
- IOException
 
 
-