]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/ApplicationSettings.java
Salome HOME
app.root property is removed.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / ApplicationSettings.java
index 21f17c28e6349a075b90cf6ab0300ae2f9396641..116d7b7189072c472e5d3c7acd072e8006c41ace 100644 (file)
@@ -13,6 +13,7 @@ import java.util.Properties;
 import java.util.Set;
 import java.util.Vector;
 
+import javax.servlet.ServletContext;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import org.w3c.dom.Node;
@@ -38,8 +39,9 @@ import org.splat.wapp.PopupMenu;
 import org.splat.wapp.PopupItem;
 import org.splat.wapp.SimpleMenu;
 import org.splat.wapp.ToolBar;
+import org.springframework.web.context.ServletContextAware;
 
-public class ApplicationSettings {
+public class ApplicationSettings implements ServletContextAware {
 
        /**
         * Application settings logger.
@@ -47,6 +49,11 @@ public class ApplicationSettings {
        protected final static Logger logger = Logger
                        .getLogger(ApplicationSettings.class);
 
+       /**
+        * Injected servlet context to get path to resources.
+        */
+       private ServletContext _servletContext; 
+       
        private String wappserver;
        private String wappname;
        private Properties wapprops; // General properties from the application properties files
@@ -706,8 +713,8 @@ public class ApplicationSettings {
        }
 
        public String getApplicationRootPath() {
-               // ---------------------------------------
-               return getApplicationProperty("wapp.root"); // The property is supposed including the Web application name
+               //RKV: return getApplicationProperty("wapp.root"); // The property is supposed including the Web application name
+               return _servletContext.getRealPath("/");
        }
 
        public String getApplicationURL() {
@@ -948,4 +955,14 @@ public class ApplicationSettings {
        public void setDocumentTypeService(DocumentTypeService documentTypeService) {
                _documentTypeService = documentTypeService;
        }
+
+       /** 
+        * {@inheritDoc}
+        * @see org.apache.struts2.util.ServletContextAware#setServletContext(javax.servlet.ServletContext)
+        */
+       @Override
+       public void setServletContext(ServletContext context) {
+               _servletContext = context;
+       }
+
 }
\ No newline at end of file