01: /******************************************************************************
02: * ResponderCANVAS.java
03: * ****************************************************************************/package org.openlaszlo.servlets.responders;
04:
05: import java.io.*;
06: import java.util.*;
07: import java.net.URLEncoder;
08: import java.util.Enumeration;
09: import java.util.Properties;
10: import javax.servlet.ServletConfig;
11: import javax.servlet.ServletException;
12: import javax.servlet.ServletOutputStream;
13: import javax.servlet.http.HttpSession;
14: import javax.servlet.http.HttpServletRequest;
15: import javax.servlet.http.HttpServletResponse;
16: import org.openlaszlo.compiler.Canvas;
17: import org.openlaszlo.compiler.CompilationError;
18: import org.openlaszlo.utils.*;
19: import org.apache.log4j.Logger;
20:
21: public final class ResponderCANVAS extends ResponderCompile {
22:
23: /**
24: * @param fileName Full pathname to file from request.
25: */
26: protected void respondImpl(String fileName, HttpServletRequest req,
27: HttpServletResponse res) throws IOException {
28: ServletOutputStream out = res.getOutputStream();
29: try {
30: res.setContentType("text/xml");
31: Canvas canvas = getCanvas(fileName, req);
32: String xml = canvas.getXML(ResponderAPP_CONSOLE
33: .getRequestXML(req, fileName));
34: out.write(xml.getBytes());
35: } finally {
36: FileUtils.close(out);
37: }
38: }
39:
40: public int getMimeType() {
41: return MIME_TYPE_XML;
42: }
43:
44: }
|