Menu

#18 by default send action output to a ByteArrayOutputStream

open
nobody
None
5
2004-07-06
2004-07-06
No

Currently action output is written to stdout. It's handy for those of us with actions that don't use forwards (most do but some serve real data) if we can capture that data for testing. In my test cases I override actionPerform like this:

private ByteArrayOutputStream outStream;

public void actionPerform()
{
outStream = new ByteArrayOutputStream();
response.setOutputStream(outStream);
super.actionPerform();
}

protected ByteArrayOutputStream getOutputStream()
{
return outStream;
}

It would be great if this were the default behavior.

++Brian

Discussion


Log in to post a comment.