FileDocCategorySizeDatePackage
WMHello.javaAPI DocExample827Thu Apr 05 20:29:14 BST 2001None

WMHello

public class WMHello extends HttpServlet

Fields Summary
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)

    FastWriter out = new FastWriter(res.getOutputStream(),
                                    res.getCharacterEncoding());

    try {
      WebMacro wm = new WM(); // optionally WM("/path/to/config/file")
      Context c = wm.getWebContext(req, res);
      c.put("date", new Date());
      Template tmpl = wm.getTemplate("hello.wm");
      tmpl.write(out, c);
      out.flush();
    }
    catch (WebMacroException e) {
      throw new ServletException(e);
    }