commit | author | age
|
17727f
|
1 |
package de.uhilger.filecms.web; |
U |
2 |
|
|
3 |
import java.util.logging.Logger; |
|
4 |
import javax.servlet.ServletContext; |
|
5 |
import javax.servlet.ServletContextEvent; |
|
6 |
import javax.servlet.ServletContextListener; |
|
7 |
|
|
8 |
/** |
|
9 |
* |
|
10 |
*/ |
|
11 |
public class InitialiserHome implements ServletContextListener { |
|
12 |
|
|
13 |
public static final String FILE_BASE = "filebase"; |
|
14 |
|
|
15 |
private static final Logger logger = Logger.getLogger(Initialiser.class.getName()); |
|
16 |
|
|
17 |
@Override |
|
18 |
public void contextInitialized(ServletContextEvent sce) { |
|
19 |
ServletContext ctx = sce.getServletContext(); |
|
20 |
StringBuilder sb = new StringBuilder(); |
|
21 |
sb.append(System.getProperty("user.home")); |
|
22 |
sb.append("/file-cms"); |
|
23 |
System.out.println(" FILE_BASE: " + sb.toString()); |
|
24 |
ctx.setAttribute(FILE_BASE, sb.toString()); |
|
25 |
} |
|
26 |
|
|
27 |
@Override |
|
28 |
public void contextDestroyed(ServletContextEvent sce) { |
|
29 |
ServletContext ctx = sce.getServletContext(); |
|
30 |
ctx.removeAttribute(FILE_BASE); |
|
31 |
} |
|
32 |
|
|
33 |
} |