Solved

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

Posted on 2013-11-20
3
436 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jar file executable 12 58
Configure a Bean in an XML file 4 42
Problem to Alipay 10 42
maven not picking latest jar instead picking old jar from .m2 12 17
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

808 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