1 16 package org.directwebremoting.servlet; 17 18 import java.io.IOException ; 19 20 import javax.servlet.http.HttpServletRequest ; 21 import javax.servlet.http.HttpServletResponse ; 22 23 import org.directwebremoting.dwrp.HtmlCallMarshaller; 24 import org.directwebremoting.extend.Calls; 25 import org.directwebremoting.extend.Handler; 26 import org.directwebremoting.extend.Remoter; 27 import org.directwebremoting.extend.Replies; 28 29 33 public class HtmlCallHandler implements Handler 34 { 35 38 public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException 39 { 40 Calls calls = null; 41 42 try 43 { 44 calls = htmlCallMarshaller.marshallInbound(request, response); 45 } 46 catch (Exception ex) 47 { 48 htmlCallMarshaller.marshallException(request, response, ex); 49 return; 50 } 51 52 Replies replies = remoter.execute(calls); 53 htmlCallMarshaller.marshallOutbound(replies, request, response); 54 } 55 56 60 public void setHtmlCallMarshaller(HtmlCallMarshaller marshaller) 61 { 62 this.htmlCallMarshaller = marshaller; 63 } 64 65 69 public void setRemoter(Remoter remoter) 70 { 71 this.remoter = remoter; 72 } 73 74 77 protected HtmlCallMarshaller htmlCallMarshaller = null; 78 79 82 protected Remoter remoter = null; 83 } 84 | Popular Tags |