Solved

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

Posted on 2013-11-20
3
395 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
Comment Utility
y its showing bin folder ??
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
Comment Utility
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
Comment Utility
:-)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Logs to delete in Windows VCenter server ? 11 158
scoresSpecial  challenge 13 40
powerN  challenge 3 47
countHi2 challenge 7 44
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

743 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

15 Experts available now in Live!

Get 1:1 Help Now