|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mentawai.core.StreamConsequence
public class StreamConsequence
A web-based consequence that gets a ready-to-use input stream from the output of the action, get the contents from that input stream and flush them to the servlet output stream. Very useful for loading images from a database, downloads and other resources that the programmer may want to protect from direct access from the client. This class is thread-safe.
| Field Summary | |
|---|---|
static String |
APPLICATION_OGG
Ogg, a multimedia bitstream container format. |
static String |
APPLICATION_PDF
Portable Document Format. |
static String |
APPLICATION_SOAP
SOAP. |
static String |
AUDIO_MPEG
MP3 or other MPEG audio. |
static String |
AUDIO_OGG
Ogg Vorbis, Speex, Flac and other audio. |
static String |
CONTENT_DISPOSITION
The default key ("contentDisposition") to look for in the action output. |
static String |
CONTENT_LENGTH
The default key ("contentLength") to look for in the action output. |
static String |
CONTENT_TYPE
The default key ("contentType") to look for in the action output. |
static String |
EXCEL
|
static String |
FILENAME
|
static String |
IMAGE_GIF
GIF image. |
static String |
IMAGE_JPEG
JPEG JFIF image. |
static String |
IMAGE_PNG
Portable Network Graphics. |
static String |
STREAM
The default key ("stream") to look for in the action output. |
| Constructor Summary | |
|---|---|
StreamConsequence()
Creates a new instance of the StreamConsequence class. |
|
StreamConsequence(String contentType)
Creates a new instance of the StreamConsequence class, with the given content-type |
|
| Method Summary | |
|---|---|
protected void |
defineHeader(javax.servlet.http.HttpServletResponse res,
Output output)
|
void |
execute(Action a,
String result,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Executes the action, reading from the input stream the data that has to be flushed into the servlet output stream. |
StreamConsequence |
keyForContentDisposition(String key)
|
StreamConsequence |
keyForContentLength(String key)
|
StreamConsequence |
keyForContentType(String key)
|
StreamConsequence |
keyForFilename(String key)
|
StreamConsequence |
keyForStream(String key)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String STREAM
public static final String CONTENT_DISPOSITION
public static final String CONTENT_LENGTH
public static final String CONTENT_TYPE
public static final String APPLICATION_OGG
public static final String APPLICATION_PDF
public static final String APPLICATION_SOAP
public static final String AUDIO_MPEG
public static final String AUDIO_OGG
public static final String IMAGE_GIF
public static final String IMAGE_JPEG
public static final String IMAGE_PNG
public static final String EXCEL
public static final String FILENAME
| Constructor Detail |
|---|
public StreamConsequence()
public StreamConsequence(String contentType)
contentType - The content type to set in the servlet response.| Method Detail |
|---|
public StreamConsequence keyForFilename(String key)
public StreamConsequence keyForContentType(String key)
public StreamConsequence keyForContentDisposition(String key)
public StreamConsequence keyForContentLength(String key)
public StreamConsequence keyForStream(String key)
public void execute(Action a,
String result,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws ConsequenceException
execute in interface Consequencea - The action that generated this consequence.result - The result generated by the action.req - The servlet request of the action.res - The servlet response of the action.
ConsequenceException
protected void defineHeader(javax.servlet.http.HttpServletResponse res,
Output output)
throws ConsequenceException
ConsequenceException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||