[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

Application Path

Hi,
   I have installed javawebserver2.0 in my machine's "E:" drive.I had kept a text file in "E:\javawebserver2.0\public_html\txt\text.txt".I have generated a class file.but my client installed the javawebserver2.0 in "H:\javawebserver2.0".He downloaded the class file.It won't work because of path problem.How to resolve this path problem?.
0
Raju112699
Asked:
Raju112699
  • 2
1 Solution
 
rainmalCommented:
Don't hard code the drive path.
Try using getRealPath() to get the real path to the servlet and then concat the drive letter from this string.
0
 
rainmalCommented:
Well no need to concat anything really.
Just call
getRealPath("/");
 
This will return the real path of the Document Root dir of the server
in your case the foll
your installation drive:\javawebserver2.0\public_html

You can move up from there to \txt\....whatever

0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now