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

  • SEARCH
  • Home
  • 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 939657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:49:31+00:00 2026-05-15T21:49:31+00:00

I want to set a path in my web.xml which is relative to the

  • 0

I want to set a path in my web.xml which is relative to the WEB-INF or the WEB-INF/classes.

However, the following code (repository.home) seems to pick up a path relative to c: root drive path on my windows machine here.

    <servlet>
  <servlet-name>ContentRepository</servlet-name>
  <servlet-class>org.apache.jackrabbit.servlet.jackrabbit.JackrabbitRepositoryServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
    <init-param>
      <param-name>repository.home</param-name>
      <param-value>/WEB-INF/classes/testit</param-value>
    </init-param>
</servlet>

<servlet>
  <servlet-name>JackrabbitServlet</servlet-name>
  <servlet-class>com.orsa.seam.JackrabbitServlet</servlet-class>
  <load-on-startup>2</load-on-startup>
</servlet>
  • 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-15T21:49:32+00:00Added an answer on May 15, 2026 at 9:49 pm

    That parameter is OK, i.e. when you read it, it will be still a String with the value:

    /WEB-INF/classes/testit

    A parameter in web.xml file is just a parameter – it’s not a “path”.

    So the question is what you do with that parameter?

    Since you are trying to access resources(files) inside a servlet container, you need to use specific methods, e.g. something like

    ServletContext#getRealPath()

    to get the real path of e.g. /WEB-INF/classes/testit, than

    • append to it what you need (thus having a full path to those files inside that directory), or subtract it from other “full paths”, thus having the relative paths to it. E.g. if you have ‘/testit/test1.txt’ ‘/testit/test2.txt’ you can access those files by just appending them to the real path obtained above.

    • Or subtract that path from other ‘full paths’, thus having the relative path to your parameter. E.g. if you have the full path (c:/tomcat/webapps/myapp/WEB-INF/data/testit/test.txt), than you just need to subtract that full path of your parameter, so you will obtain the relative path: ‘/testit/test2.txt’

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

Sidebar

Related Questions

Hi I want to set dynamic path to my picture box in winforms. Is
I have a simple program. I want to set the path and some properties
I want to set configuration variable (path, in particular) in CMakeList.txt for my project,
currently I am running my web service from following path http://localhost:16022/MachineService.asmx and usage of
I want to read xml on runtime, without save it on a path After
I have a batch file which takes as an argument a file path set
I want to set up .htaccess on my Apache web server such that all
I want to set up a Mercurial SC server and have been following the
after surfing the web I realized that I should set the class path the
I want set interfaceOrientation in one UIView as LandscapeLeft and Portrait in other UIView.

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.