|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.stripes.action.StreamingResolution
public class StreamingResolution
Resolution for streaming data back to the client (in place of forwarding the user to another page). Designed to be used for streaming non-page data such as generated images/charts and XML islands.
Optionally supports the use of a file name which, if set, will cause a Content-Disposition header to be written to the output, resulting in a "Save As" type dialog box appearing in the user's browser. If you do not wish to supply a file name, but wish to acheive this behaviour, simple supply a file name of "".
| Constructor Summary | |
|---|---|
StreamingResolution(String contentType,
InputStream inputStream)
Constructor that builds a StreamingResolution that will stream binary data back to the client and identify the data as being of the specified content type. |
|
StreamingResolution(String contentType,
Reader reader)
Constructor that builds a StreamingResolution that will stream character data back to the client and identify the data as being of the specified content type. |
|
| Method Summary | |
|---|---|
void |
execute(HttpServletRequest request,
HttpServletResponse response)
Streams data from the InputStream or Reader to the response's OutputStream or PrinterWriter, using a moderately sized buffer to ensure that the operation is reasonable efficient. |
StreamingResolution |
setFilename(String filename)
Sets the filename that will be the default name suggested when the user is prompted to save the file/stream being sent back. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamingResolution(String contentType,
InputStream inputStream)
contentType - the content type of the data in the stream (e.g. image/png)inputStream - an InputStream from which to read the data to return to the client
public StreamingResolution(String contentType,
Reader reader)
contentType - the content type of the data in the stream (e.g. text/xml)reader - a Reader from which to read the character data to return to the client| Method Detail |
|---|
public StreamingResolution setFilename(String filename)
filename - the default filename the user will see
public void execute(HttpServletRequest request,
HttpServletResponse response)
throws Exception
execute in interface Resolutionrequest - the HttpServletRequest being processedresponse - the paired HttpServletReponse
IOException - if there is a problem accessing one of the streams or reader/writer
objects used.
Exception - exceptions of any type may be thrown if the Resolution cannot be
executed as intended
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||