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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2274 - (hide annotations) (download)
Fri Feb 13 11:48:23 2015 UTC (9 years, 3 months ago) by torben
File size: 1149 byte(s)
First functioning edition
1 torben 2274 package dk.daoas.daoadresseservice;
2    
3     import java.sql.SQLException;
4    
5     import javax.servlet.ServletContext;
6     import javax.servlet.ServletContextEvent;
7     import javax.servlet.ServletContextListener;
8     import javax.servlet.annotation.WebListener;
9    
10     /**
11     * Application Lifecycle Listener implementation class ContextListener
12     *
13     */
14     @WebListener
15     public class ContextListener implements ServletContextListener {
16    
17    
18     public ContextListener() {
19     // TODO Auto-generated constructor stub
20     }
21    
22     public void contextDestroyed(ServletContextEvent ctxtEvt) {
23     // TODO Auto-generated method stub
24     }
25    
26     public void contextInitialized(ServletContextEvent ctxtEvt) {
27     System.out.println("Starting DAO Context");
28    
29     ServletContext ctxt = ctxtEvt.getServletContext();
30    
31     AdressSearch search = new AdressSearch();
32     try {
33     search.buildSearchStructures();
34     ctxt.setAttribute("search", search);
35     } catch (SQLException e) {
36     System.out.println("Error loading data: " + e.getMessage());
37     }
38    
39    
40    
41     System.out.println("DAO Context done");
42     }
43    
44     }

  ViewVC Help
Powered by ViewVC 1.1.20