1 /* $Id: HelloCSServlet.java,v 1.1 2002/09/20 22:13:08 jeske Exp $ 2 * 3 */ 4 5 import java.io.*; 6 import java.text.*; 7 import java.util.*; 8 import javax.servlet.*; 9 import javax.servlet.http.*; 10 11 import org.clearsilver.*; 12 13 /** 14 * The simplest possible Clearsilver servlet. 15 * 16 */ 17 18 public class HelloCSServlet extends HttpServlet { 19 20 public void doGet(HttpServletRequest request, 21 HttpServletResponse response) 22 throws IOException, ServletException 23 { 24 25 26 PrintWriter out = response.getWriter(); 27 HDF hdf = new HDF(); 28 29 hdf.setValue("Foo.Bar","1"); 30 31 CS cs = new CS(hdf); 32 cs.parseStr("Hello Clearsilver<p>Foo.Bar: <?cs var:Foo.Bar ?>"); 33 34 35 36 response.setContentType("text/html"); 37 out.print(cs.render()); 38 } 39 } 40 41 42 43