struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sathesh Kumar <forum-struts-...@opensymphony.com>
Subject How to get web application file path from java stand alone program?
Date Thu, 01 Nov 2007 07:07:03 GMT
Hi all,
        I am using Jboss server with struts.I used java class for getting the real path 
of web application.This class iscalled  by my Sheduler class that is run automatically when
application server start and not called by Action class.
        How I get web application path from my java class?

Here is my code

class MyJavaClss
{

static getPath()
{
String path="";  // How I get the path of "... //webroot//report/report.xml"
}

}

In Action class I can do with

getServlet().getServletContext().geRealPath("\\report\\JReports\\summary\\");

It gives currect path like

C:\jboss-4.0.1sp1\server\default\deploy\united.war\report\JReports\summary

But how I get this path from my Java Class (not struts Action class)
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=151372&messageID=224111#224111


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message