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); |
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 |
|
|