Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The content type output is treated like an input since the presence of a content type output implies that your Action bean intends to write to a pre-existing data stream. Prior to the invocation of your Action's execute method, this pre-existing stream is retrieved by the Action framework and passed to your Action bean as a java.io.OuputStream. If you intend your Action bean to be able to handle content type outputs, and thus writing to an output stream, then your Action bean is required to implement IStreamingAction. This API provides the Action framework with information about the type of data you are writing to the stream.

There is a special syntax for the setter of a streaming output. The Action framework will look for a setter with the word "Stream" is appended to the action definition output name. In the example below you see that the output name is "myOutput" yet the setter on the Action bean is "myOutputStream". This is intention and was done to help keep this special operation more clear. We didn't want to force action sequence writers to have to call their output any specific name, yet we wanted the setter to indicate what type it was accepting, since "setMyOuput", for example did not seem to be as clear as "setMyOutputStream". In any case, just note that your setter method name always need to end in "Stream".

xaction output

Java type

expected Action bean method (Java)

<myOutput type="content"/>

java.io.OutputStream

public void setMyOutputStream(OutputStream o)
{ ...

...