KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > phoneList > presentation > ErrorPresentation


1 package phoneList.presentation;
2
3
4 // Standard imports
5
import java.util.Vector JavaDoc;
6 import java.io.IOException JavaDoc;
7
8 // Enhydra SuperServlet imports
9
import com.lutris.appserver.server.httpPresentation.HttpPresentation;
10 import com.lutris.appserver.server.httpPresentation.HttpPresentationComms;
11 import com.lutris.appserver.server.httpPresentation.HttpPresentationException;
12 import org.w3c.dom.html.HTMLAnchorElement;
13 import org.w3c.dom.Node JavaDoc;
14
15 public class ErrorPresentation implements HttpPresentation {
16
17   private static ErrorHTML error;
18
19   public void run(HttpPresentationComms comms) throws HttpPresentationException, IOException JavaDoc {
20
21     try{
22       OutputError(comms);
23     }catch(Exception JavaDoc e){
24       e.printStackTrace();
25     }
26   }
27
28
29   public static void OutputError(HttpPresentationComms comms) throws Exception JavaDoc {
30     String JavaDoc errorText = comms.request.getParameter("err");
31     error = (ErrorHTML)comms.xmlcFactory.create(ErrorHTML.class);
32     error.setTextError(errorText);
33     comms.response.writeDOM(error);
34    }
35 }
36
37
Popular Tags