1 package phoneList.presentation; 2 3 import phoneList.spec.*; 4 5 import java.util.Vector ; 7 import java.io.IOException ; 8 9 import com.lutris.appserver.server.httpPresentation.HttpPresentation; 11 import com.lutris.appserver.server.httpPresentation.HttpPresentationComms; 12 import com.lutris.appserver.server.httpPresentation.HttpPresentationException; 13 import org.w3c.dom.html.HTMLAnchorElement; 14 import org.w3c.dom.Node ; 15 16 public class ModifyServerPresentation implements HttpPresentation { 17 18 private static ModifyServerHTML ms; 19 20 public void run(HttpPresentationComms comms) throws HttpPresentationException, IOException { 21 22 try{ 23 modifyServer(comms); 24 }catch(Exception e){ 25 e.printStackTrace(); 26 } 27 } 28 29 30 public static void modifyServer(HttpPresentationComms comms) throws Exception { 31 ms = (ModifyServerHTML)comms.xmlcFactory.create(ModifyServerHTML.class); 32 try{ 33 PhoneList phoneList = PhoneListFactory.getPhoneList("phoneList.business.PhoneListImpl"); 34 35 String server=phoneList.getServer(); 36 String port=phoneList.getPort(); 37 38 39 ms.getElementPort().setValue(port); 40 ms.getElementServer().setValue(server); 41 42 46 } catch(NullPointerException ex) {} 47 comms.response.writeDOM(ms); 48 } 49 50 } 51 52 | Popular Tags |