1 16 package org.directwebremoting.servlet; 17 18 import java.io.IOException ; 19 import java.io.PrintWriter ; 20 21 import javax.servlet.http.HttpServletRequest ; 22 import javax.servlet.http.HttpServletResponse ; 23 24 import org.directwebremoting.extend.DebugPageGenerator; 25 import org.directwebremoting.extend.Handler; 26 import org.directwebremoting.util.MimeConstants; 27 28 32 public class IndexHandler implements Handler 33 { 34 37 public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException 38 { 39 String page = debugPageGenerator.generateIndexPage(request.getContextPath() + request.getServletPath()); 40 41 response.setContentType(MimeConstants.MIME_HTML); 42 PrintWriter out = response.getWriter(); 43 out.print(page); 44 } 45 46 50 public void setDebugPageGenerator(DebugPageGenerator debugPageGenerator) 51 { 52 this.debugPageGenerator = debugPageGenerator; 53 } 54 55 58 protected DebugPageGenerator debugPageGenerator = null; 59 } 60 | Popular Tags |