1 24 25 package enhydraFlash.presentation; 26 27 import com.lutris.appserver.server.httpPresentation.*; 29 30 import java.util.Date ; 31 import java.text.DateFormat ; 32 33 import enhydraFlash.presentation.xml.*; 34 35 public class ShowName implements HttpPresentation { 36 37 38 public void run(HttpPresentationComms comms) 39 throws HttpPresentationException { 40 try { 41 if(comms.request.getParameter("flash") != null) { 42 handleFlash(comms); 43 } 44 else { 45 46 ShowNamePageHTML page = (ShowNamePageHTML)comms.xmlcFactory.create(ShowNamePageHTML.class); 47 comms.response.writeDOM(page); 48 } 49 } catch (Exception e) { 50 System.out.println("EXCEPTION in ShowPage" + e); 51 } 52 } 53 54 55 public void handleFlash(HttpPresentationComms comms) { 56 57 try { 58 String name = comms.session.getSessionData().getString("NAME"); 59 if(name == null) 60 name = DateFormat.getTimeInstance(DateFormat.SHORT).format(new Date ()); 61 62 ShowNameXML page = (ShowNameXML)comms.xmlcFactory.create(ShowNameXML.class); 63 page.setTextName(name); 64 comms.response.setEncoding("ISO8859-1"); 65 comms.response.writeDOM(page); 66 } catch (Exception e) { 67 System.out.println("EXCEPTION in ShowPage" + e); 68 } 69 } 70 71 } 72 | Popular Tags |