Solved

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

Posted on 2013-11-20
3
439 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SequenceInputStream example 3 22
Bot application - advice 3 64
hashmap order 17 43
restrict decimal places for double datatype 10 34
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

730 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