Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4074100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:07:12+00:00 2026-05-20T17:07:12+00:00

So I have a file structure like below http://dl.dropbox.com/u/322696/FolderPath.JPG When I start the Tomcat

  • 0

So I have a file structure like below

http://dl.dropbox.com/u/322696/FolderPath.JPG

When I start the Tomcat Server, I’m trying to figure out where it’s root folder begins with if I were just to start the server in the server window and access a jsp page within the jsp folder. I need to navigate to images/banner/name.jpg (trying to make an image file). I’ve set the servers context to ‘/projectname’ (the black rectangle next to [repository]). I’ve tried like:

File image = new File("../images/banner/name.jpg"); //If its root was the jsp I accessed

No dice. Is there a method I could run to determine what the relative path should be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:07:13+00:00Added an answer on May 20, 2026 at 5:07 pm

    Are you asking how to get the on disk path from within tomcat? If so you use the ServletContext.

    getServletContext().getRealPath(“/”)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file with the structure like so: http://gamedev.pastebin.com/8iESYTVY but it's much bigger
I have a zip file containing a folder structure like main-folder/ subFolder1/ subFolder2/ subFolder3/
I have a data structure which is as given below: class File { public
If i have the following directory structure: Project1/bin/debug Project2/xml/file.xml I am trying to refer
I have a document that it's structure is like below. There are a lot
Consider I have a table, like below, that I am trying to populate with
the json file's structure which I will deserialize looks like below; { id :
Assume that I have a table structure like seen below location|name ------------- NY|john London|neil
I have a structure like below that needs to be saved and loaded from
I have to define the grammar of a file like the one shown below.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.