FileDocCategorySizeDatePackage
StrutsMockJspWriter.javaAPI DocExample4547Mon Jul 23 13:26:16 BST 2007org.apache.struts2.views.jsp

StrutsMockJspWriter

public class StrutsMockJspWriter extends javax.servlet.jsp.JspWriter
Unforunately, the MockJspWriter throws a NotImplementedException when any of the Writer methods are invoked and as you might guess, Velocity uses the Writer methods. I'velocityEngine subclassed the MockJspWriter for the time being so that we can do testing on the results until MockJspWriter gets fully implemented.

todo replace this once MockJspWriter implements Writer correctly (i.e. doesn't throw NotImplementException)

Fields Summary
StringWriter
writer
Constructors Summary
public StrutsMockJspWriter(StringWriter writer)

        super(1024, true);
        this.writer = writer;
    
Methods Summary
public voidclear()

    
public voidclearBuffer()

    
public voidclose()

        writer.close();
    
public voidflush()

        writer.flush();
    
public intgetRemaining()

        return 0;
    
public voidnewLine()

        writer.write("\n");
    
public voidprint(java.lang.String s)

        writer.write(s);
    
public voidprint(java.lang.Object o)

        writer.write(o.toString());
    
public voidprint(boolean b)

        writer.write(String.valueOf(b));
    
public voidprint(char c)

        writer.write(String.valueOf(c));
    
public voidprint(int i)

        writer.write(i);
    
public voidprint(long l)

        writer.write(String.valueOf(l));
    
public voidprint(float v)

        writer.write(String.valueOf(v));
    
public voidprint(double v)

        writer.write(String.valueOf(v));
    
public voidprint(char[] chars)

        writer.write(chars);
    
public voidprintln()

        writer.write("\n");
    
public voidprintln(boolean b)

        print(b);
        println();
    
public voidprintln(char c)

        print(c);
        println();
    
public voidprintln(int i)

        print(i);
        println();
    
public voidprintln(long l)

        print(l);
        println();
    
public voidprintln(float v)

        print(v);
        println();
    
public voidprintln(double v)

        print(v);
        println();
    
public voidprintln(char[] chars)

        print(chars);
        println();
    
public voidprintln(java.lang.String s)

        print(s);
        println();
    
public voidprintln(java.lang.Object o)

        print(o);
        println();
    
public voidwrite(char[] cbuf, int off, int len)

        writer.write(cbuf, off, len);
    
public voidwrite(java.lang.String str)

        writer.write(str);
    
public voidwrite(int c)

        writer.write(c);
    
public voidwrite(char[] cbuf)

        writer.write(cbuf);
    
public voidwrite(java.lang.String str, int off, int len)

        writer.write(str, off, len);