my dog learned polymorphism*
The moose likes Struts and the fly likes how to get  strut applications root directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to get  strut applications root directory" Watch "how to get  strut applications root directory" New topic
Author

how to get strut applications root directory

Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
hai ,


plz help me . i m new to struts.i want to get my application directory in my action java file.

i specified the root in context path. i want to get that one.

i used this thing to get the root of my application.

getServletContext().getServletConfig().getRealpath("");

i got error.my application directory which i mentioned is c:\project
i want to get that root. please help mee........

Swathi
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
add a / to the string argument to getRealpath, ie: getRealPath("/")
Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
Thank u Ray . i Got the Answer..


Swathi

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get strut applications root directory
 
Similar Threads
NetBeans & Tomcat
Save a file on the application root
Jarring Problem
Installation of a Swing Application
Changing tomcat default working directory