/[projects]/dao/DaoAdresseService/src/dk/daoas/daoadresseservice/ContextListener.java
ViewVC logotype

Diff of /dao/DaoAdresseService/src/dk/daoas/daoadresseservice/ContextListener.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2350 by torben, Mon Feb 23 14:39:49 2015 UTC revision 2351 by torben, Mon Feb 23 15:20:10 2015 UTC
# Line 34  public class ContextListener implements Line 34  public class ContextListener implements
34                    
35          ServletContext ctxt = ctxtEvt.getServletContext();          ServletContext ctxt = ctxtEvt.getServletContext();
36                    
37          initDataLoader(ctxt);          ServiceConfig conf = initConfig(ctxt);
38          initConfig(ctxt);          
39            initDataLoader(ctxt,conf);
40            
41                    
42          System.out.println("DAO Context done");          System.out.println("DAO Context done");
43      }      }
44            
45      private void initDataLoader(ServletContext ctxt) {      private void initDataLoader(ServletContext ctxt, ServiceConfig conf) {
46          DataLoader load = new DataLoader(ctxt);                  DataLoader load = new DataLoader(ctxt,conf);            
47          ctxt.setAttribute("dataloader", load);          ctxt.setAttribute("dataloader", load);
48          load.doLoad();          load.doLoad();
49      }      }
50                    
51            
52      private void initConfig(ServletContext ctxt) {      private ServiceConfig initConfig(ServletContext ctxt) {
53          ServiceConfig conf = new ServiceConfig();          ServiceConfig conf = new ServiceConfig();
54                    
55          new ContextConfigLoader(ctxt).loadConfig(conf);          new ContextConfigLoader(ctxt).loadConfig(conf);
# Line 59  public class ContextListener implements Line 61  public class ContextListener implements
61          servlet.setConfigObject( conf );          servlet.setConfigObject( conf );
62          ServletRegistration.Dynamic dynconf = ctxt.addServlet("webconfig", servlet );          ServletRegistration.Dynamic dynconf = ctxt.addServlet("webconfig", servlet );
63          dynconf.addMapping("/ConfigServlet");          dynconf.addMapping("/ConfigServlet");
64                    
65                    return conf;    
66                    
67      }      }
68            
69                    

Legend:
Removed from v.2350  
changed lines
  Added in v.2351

  ViewVC Help
Powered by ViewVC 1.1.20