|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.directwebremoting.extend.ScriptConduit
org.directwebremoting.dwrp.BaseScriptConduit
org.directwebremoting.dwrp.Html4kScriptConduit
public class Html4kScriptConduit
A ScriptConduit for use with HTML/PRE wrapped Javascript output.
Scripts begin with an html, body and pre tag followed by plain Javascript without 'execute-in-parent-context' wrapping, but with script-start and script-end markers.
If this conduit is used the client should direct the output to an iframe and then poll, looking for new data into the iframe. The html tags should be removed and script between script-start and script-end tags eval()ed.
This conduit also sends 4k of whitespace data on each flush. This causes IE to recognise new content. This would be a significant network overhead so it is important to use gzip on the connection. This complexity has caused us to turn this conduit off at the moment.
Field Summary |
---|
Fields inherited from class org.directwebremoting.extend.ScriptConduit |
---|
RANK_FAST, RANK_PROCEDURAL, RANK_SLOW |
Constructor Summary | |
---|---|
Html4kScriptConduit(javax.servlet.http.HttpServletResponse response,
java.lang.String batchId,
ConverterManager converterManager)
Simple ctor |
Method Summary | |
---|---|
boolean |
addScript(ScriptBuffer scriptBuffer)
Add a script to the list bound for remote execution. |
void |
beginStream()
Called when we are initially setting up the stream. |
void |
endStream()
Called when we are shutting the stream down. |
Methods inherited from class org.directwebremoting.dwrp.BaseScriptConduit |
---|
close, getErrorAlarm |
Methods inherited from class org.directwebremoting.extend.ScriptConduit |
---|
compareTo, equals, getRank, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Html4kScriptConduit(javax.servlet.http.HttpServletResponse response, java.lang.String batchId, ConverterManager converterManager) throws java.io.IOException
response
- Used to flush outputbatchId
- The id of the batch that we are responding toconverterManager
- How we convert objects to script
java.io.IOException
- If stream ops failMethod Detail |
---|
public void beginStream()
BaseScriptConduit
This method is always called exactly once in the lifetime of a
conduit, after #preStreamSetup()
and before any scripts are sent.
public void endStream()
BaseScriptConduit
This method is always called exactly once in the lifetime of a conduit, just before the stream is closed.
public boolean addScript(ScriptBuffer scriptBuffer) throws java.io.IOException, MarshallException
ScriptConduit
It is not an error to refuse to handle the script and return false, it
just indicates that this ScriptConduit did not accept the script.
If the ScriptConduit can no longer function then it should throw an
exception and it will be asumed to be no longer useful.
If you want to implement this method then you will probably be doing
something like calling ServletOutputStream.print(String)
and
passing in the results of calling ScriptBufferUtil.createOutput().
addScript
in class ScriptConduit
scriptBuffer
- The script to execute
java.io.IOException
- If this conduit is broken and should not be used
MarshallException
- If objects in the script can not be marshalled
|
Copyright ? 2005 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |