1 56 57 58 package org.hamletsoft.enhydra.cactus.presentation; 59 60 import java.io.*; 61 import java.lang.reflect.*; 62 import java.net.*; 63 import java.util.*; 64 import javax.servlet.*; 65 import javax.servlet.http.*; 66 import java.lang.Thread ; 67 import org.apache.cactus.*; 68 import org.apache.log4j.Logger; 70 import org.apache.log4j.PropertyConfigurator; 71 import com.lutris.appserver.server.httpPresentation.HttpPresentation; 73 import com.lutris.appserver.server.httpPresentation.HttpPresentationComms; 74 import com.lutris.appserver.server.httpPresentation.HttpPresentationException; 75 import javax.servlet.ServletException ; 76 import org.hamletsoft.enhydra.cactus.spec.*; 77 78 86 public class EnhydraAppTestRedirector 87 implements HttpPresentation { 88 93 96 private static Logger logger; 97 static { 98 PropertyConfigurator.configure("log_server.properties"); 100 101 logger = Logger.getLogger(EnhydraAppTestRedirector.class.getName()); 102 } 103 104 109 public void run (HttpPresentationComms comms) throws HttpPresentationException, 110 IOException { 111 try { 112 logger.info("doRun(...)"); 113 EnhydraAppImplicitObjects objects = EnhydraAppImplicitObjectsFactory. 115 getEnhydraAppImplicitObjects("org.hamletsoft.enhydra.cactus.data.EnhydraAppImplicitObjectsImpl"); 116 objects.setHttpServletRequest(comms.request.getHttpServletRequest()); 117 objects.setHttpServletResponse(comms.response.getHttpServletResponse()); 118 objects.setHttpPresentationComms(comms); 119 objects.setServletContext(comms.application.getHttpPresentationManager().getServletContext()); 120 121 122 EnhydraAppTestController controller = EnhydraAppTestControllerFactory. 123 getEnhydraAppTestController("org.hamletsoft.enhydra.cactus.business.EnhydraAppTestControllerImpl"); 124 Thread.currentThread().sleep(5); 125 controller.handleRequest(objects); 126 logger.info("doPost"); 127 } catch (Exception e) { 128 throw new HttpPresentationException(e.getMessage(), e); 129 } 130 } 131 } 132 133 134 135 | Popular Tags |