/Users/lyon/j4p/src/javassist/sample/evolve/WebPage.java

1    package javassist.sample.evolve; 
2     
3    import java.io.*; 
4    import java.util.*; 
5     
6    /** 
7     * Updatable class.  DemoServer instantiates this class and calls 
8     * show() on the created object. 
9     */ 
10    
11   // WebPage.class.0 
12    
13   public class WebPage { 
14       public void show(OutputStreamWriter out) throws IOException { 
15           Calendar c = new GregorianCalendar(); 
16           out.write(c.getTime().toString()); 
17           out.write("<P><A HREF=\"demo.html\">Return to the home page.</A>"); 
18       } 
19   } 
20    
21   /* 
22   // WebPage.class.1 
23   public class WebPage { 
24       public void show(OutputStreamWriter out) throws IOException { 
25       out.write("<H2>Current Time:</H2>"); 
26       Calendar c = new GregorianCalendar(); 
27       out.write("<CENTER><H3><FONT color=\"blue\">"); 
28       out.write(c.getTime().toString()); 
29       out.write("</FONT></H3></CENTER><HR>"); 
30       out.write("<P><A HREF=\"demo.html\">Return to the home page.</A>"); 
31       } 
32   } 
33   */ 
34