org.directwebremoting.dwrp
Class HtmlScriptConduit

java.lang.Object
  extended by org.directwebremoting.dwrp.BaseScriptConduit
      extended by org.directwebremoting.dwrp.HtmlScriptConduit
All Implemented Interfaces:
ScriptConduit

public class HtmlScriptConduit
extends BaseScriptConduit

A ScriptConduit for use with HTML/SCRIPT wrapped Javascript output.

Scripts begin with an html and script tags. The scripts have been altered to include an 'execute-in-parent-context' wrapper.

If this conduit is used, the output should be directed to an iframe. No polling should be required.

This conduit works with IE 6/7 since the 4k buffer drawback does not prevent the execution of script elements.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
HtmlScriptConduit(java.io.PrintWriter out, java.lang.String instanceId, java.lang.String batchId, java.lang.String documentDomain)
          Simple ctor
 
Method Summary
 void beginChunk()
          Called before a each set of scripts that are to be sent.
 void beginStreamAndChunk()
          Called when we are initially setting up the stream.
 void endChunk()
          Called after each set of scripts when they have been sent.
 void endStreamAndChunk()
          Called when we are shutting the stream down.
 java.lang.String getOutboundMimeType()
          What mime type should we send to the browser for this data?
 void sendScript(java.lang.String script)
          Write a script to remote side.
 
Methods inherited from class org.directwebremoting.dwrp.BaseScriptConduit
setAccessLogLevel, setDebugScriptOutput
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlScriptConduit

public HtmlScriptConduit(java.io.PrintWriter out,
                         java.lang.String instanceId,
                         java.lang.String batchId,
                         java.lang.String documentDomain)
Simple ctor

Method Detail

getOutboundMimeType

public java.lang.String getOutboundMimeType()
Description copied from interface: ScriptConduit
What mime type should we send to the browser for this data?

Returns:
A mime-type

beginStreamAndChunk

public void beginStreamAndChunk()
Description copied from interface: ScriptConduit
Called when we are initially setting up the stream.

This method is always called exactly once in the lifetime of a conduit.


beginChunk

public void beginChunk()
Description copied from interface: ScriptConduit
Called before a each set of scripts that are to be sent.


sendScript

public void sendScript(java.lang.String script)
                throws java.io.IOException
Description copied from interface: ScriptConduit
Write a script to remote side.

Parameters:
script - The script to write
Throws:
java.io.IOException

endChunk

public void endChunk()
Description copied from interface: ScriptConduit
Called after each set of scripts when they have been sent.


endStreamAndChunk

public void endStreamAndChunk()
                       throws java.io.IOException
Description copied from interface: ScriptConduit
Called when we are shutting the stream down.

Throws:
java.io.IOException

Copyright ยจ 2008