Rev 1242 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
936 | dev | 1 | package ak.photoalbum.webapp; |
2 | |||
1248 | dev | 3 | import java.io.IOException; |
4 | import javax.servlet.ServletConfig; |
||
5 | import javax.servlet.ServletRequest; |
||
6 | import javax.servlet.ServletResponse; |
||
7 | import javax.servlet.GenericServlet; |
||
936 | dev | 8 | import javax.servlet.ServletException; |
9 | |||
10 | public class InitServlet |
||
1248 | dev | 11 | extends GenericServlet |
936 | dev | 12 | { |
13 | public void init() |
||
14 | throws ServletException |
||
15 | { |
||
1248 | dev | 16 | try { |
17 | ServletConfig config = getServletConfig(); |
||
936 | dev | 18 | |
1248 | dev | 19 | String configPath = "WEB-INF/conf/photos.xml"; |
20 | if(config.getInitParameter("config") != null) |
||
21 | configPath = config.getInitParameter("config"); |
||
22 | |||
23 | Logic.getLogic().init(new ServletResourceFactory(getServletContext()), configPath); |
||
24 | } |
||
25 | catch(Exception ex) { |
||
26 | throw new ServletException(ex); |
||
27 | } |
||
28 | } |
||
936 | dev | 29 | |
1248 | dev | 30 | public void service(ServletRequest req, ServletResponse res) |
31 | throws ServletException, IOException |
||
32 | { |
||
936 | dev | 33 | } |
34 | } |
||
1248 | dev | 35 |