aspose file tools
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 Groovy Fundamentals video training course this week in the Groovy 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

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to get strut applications root directory