01: /*
02: * Created on Jul 29, 2005
03: */
04: package uk.org.ponder.rsf.servlet;
05:
06: import javax.servlet.ServletConfig;
07: import javax.servlet.ServletContext;
08: import javax.servlet.http.HttpServlet;
09: import javax.servlet.http.HttpServletRequest;
10: import javax.servlet.http.HttpServletResponse;
11:
12: import org.springframework.web.context.WebApplicationContext;
13: import org.springframework.web.context.support.WebApplicationContextUtils;
14:
15: import uk.org.ponder.rsac.RSACBeanLocator;
16: import uk.org.ponder.util.Logger;
17:
18: /**
19: * The main servlet for the RSF system. Hands off immediately to the
20: * RootHandlerBean for all logic.
21: * @author Antranig Basman (antranig@caret.cam.ac.uk)
22: *
23: */
24: public class ReasonableServlet extends HttpServlet {
25: private RSACBeanLocator rsacbeanlocator;
26:
27: public void init(ServletConfig config) {
28: Logger.log.warn("ReasonableServlet starting up for context "
29: + config.getServletContext().getRealPath(""));
30: ServletContext sc = config.getServletContext();
31: WebApplicationContext wac = WebApplicationContextUtils
32: .getWebApplicationContext(sc);
33: rsacbeanlocator = (RSACBeanLocator) wac
34: .getBean(RSACBeanLocator.RSAC_BEAN_LOCATOR_NAME);
35: }
36:
37: protected void service(HttpServletRequest requst,
38: HttpServletResponse response) {
39: rsacbeanlocator.getBeanLocator().locateBean("rootHandlerBean");
40: }
41: }
|