i have JBoss and Tomcat, i like to make one portable webapp for both.
On JBoss i use the jboss.server.data.dir-property to store websessions.
On Tomcat id like to use the /work/-dir. But how to get the work-dir?
I just have a ApplicationContextFacade-instance on tomcat. Is it possible to get the work-dir? I looked around, found the .getWorkDir/.getWorkPath, that looks like the method i lookd for. But therefore i need an instance of Context.
1 public static String getPath(EventObject session) {
2 String path=System.getProperty("jboss.server.data.dir");
3
4 if (path == null && session.getSource() instanceof ApplicationContextFacade) {
5 ApplicationContextFacade acf = (ApplicationContextFacade) session
6 .getSource();
7
8 path = acf.getWorkDir();
9
10 }
11 return path;
12}
(line 8 doesnt work)
Regards
Try using something that is part of the servlet API:
On Tomcat, this gets you a
Fileobject that points to$CATALINA_BASE/work/[service[/[engine]/[context].