Solved

is there any replacement for java.io.File( "." ).getCanonicalPath()

Posted on 2013-11-20
3
405 Views
Last Modified: 2013-11-21
Hi,
I am using eclipse and Tomcat to develope a simple Web tool.

I have a question on the new File( "." ).getCanonicalPath() in my jsp.
When I run the web project in my eclipse, I found the new java.io.File( "." ).getCanonicalPath() is D:\eclipse,

But after I export the web project and put it into my CATALINA_HOME\webapp,
 the java.io.File( "." ).getCanonicalPath() is changed to CATALINA_HOME\bin

is there any replacement for java.io.File( "." ).getCanonicalPath() ?

or any other way to change folder to CATALINA_HOME\webapp
0
Comment
  • 2
3 Comments
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 39662515
y its showing bin folder ??
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 39662772
http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String) with "/"

is probably what you should be using, although i'm guessing at your intention
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39665606
:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now