1 16 package org.directwebremoting.dwrp; 17 18 import java.io.IOException ; 19 import java.io.PrintWriter ; 20 21 import org.directwebremoting.extend.DwrConstants; 22 import org.directwebremoting.util.MimeConstants; 23 24 28 public class PlainCallMarshaller extends BaseCallMarshaller 29 { 30 33 protected String getOutboundMimeType() 34 { 35 return MimeConstants.MIME_JS; 36 } 37 38 41 protected void sendOutboundScriptPrefix(PrintWriter out, String batchId) throws IOException 42 { 43 if (allowScriptTagRemoting) 44 { 45 synchronized (out) 46 { 47 out.println(scriptTagProtection); 48 } 49 } 50 } 51 52 55 protected void sendOutboundScriptSuffix(PrintWriter out, String batchId) throws IOException 56 { 57 } 58 59 62 protected void sendScript(PrintWriter out, String script) throws IOException 63 { 64 synchronized (out) 65 { 66 out.println(script); 67 } 68 } 69 70 74 public void setAllowScriptTagRemoting(boolean allowScriptTagRemoting) 75 { 76 this.allowScriptTagRemoting = allowScriptTagRemoting; 77 } 78 79 82 private boolean allowScriptTagRemoting = false; 83 84 88 public void setScriptTagProtection(String scriptTagProtection) 89 { 90 this.scriptTagProtection = scriptTagProtection; 91 } 92 93 96 private String scriptTagProtection = DwrConstants.SCRIPT_TAG_PROTECTION; 97 } 98 | Popular Tags |