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;
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.
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
}
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() {
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