00001 package cedar.hepdata.webapp; 00002 00003 import cedar.hepdata.model.*; 00004 import cedar.hepdata.xml.*; 00005 00006 import java.io.*; 00007 import java.util.*; 00008 import javax.servlet.*; 00009 import javax.servlet.http.*; 00010 00016 public class ModelDemo extends HttpServlet { 00017 00019 public String getServletInfo() { 00020 return "Test servlet. Do not use."; 00021 } 00022 00024 public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 00025 response.setContentType("text/html"); 00026 PrintWriter out = response.getWriter(); 00027 00028 try { 00029 out.println("<h1>Model demo</h1>"); 00030 out.println("<p>Just a call to <code>Data.makeExample().toString();</code>.</p>"); 00031 Data d = Data.makeExample(); 00032 out.println("<pre>" + d.toString() + "</pre>"); 00033 } catch (Exception e) { 00034 out.println("Exception: " + e.toString()); 00035 } 00036 00037 } 00038 }