1 16 package org.directwebremoting.dwrp; 17 18 import java.io.IOException ; 19 20 import javax.servlet.http.HttpServletResponse ; 21 22 import org.directwebremoting.ScriptBuffer; 23 import org.directwebremoting.extend.ConverterManager; 24 import org.directwebremoting.extend.MarshallException; 25 import org.directwebremoting.extend.ScriptBufferUtil; 26 import org.directwebremoting.util.MimeConstants; 27 28 32 public class PlainScriptConduit extends BaseScriptConduit 33 { 34 41 public PlainScriptConduit(HttpServletResponse response, String batchId, ConverterManager converterManager) throws IOException 42 { 43 super(response, batchId, converterManager); 44 } 45 46 49 protected String getOutboundMimeType() 50 { 51 return MimeConstants.MIME_JS; 52 } 53 54 57 public void beginStream() 58 { 59 } 60 61 64 public void endStream() 65 { 66 } 67 68 71 public boolean addScript(ScriptBuffer scriptBuffer) throws IOException , MarshallException 72 { 73 String script = ScriptBufferUtil.createOutput(scriptBuffer, converterManager); 74 75 synchronized (out) 76 { 77 out.println(ProtocolConstants.SCRIPT_START_MARKER); 78 out.println(script); 79 out.println(ProtocolConstants.SCRIPT_END_MARKER); 80 81 return flush(); 82 } 83 } 84 } 85 | Popular Tags |