Results 1 to 3 of 3
  1. #1
    trevMD is offline Member
    Join Date
    Apr 2012
    Posts
    5
    Rep Power
    0

    Default specify relative path to file in web.xml

    I'm having problem with setting the path to a file (using relative path)
    my tomact structure is

    Java Code:
    tomcat-7
        - config
            - filterConfigs
        - webapps
            - exampleWebApp
                - META-INF
                - WEB-INF
                    - web.xml
                    - classes
    in the web.xml
    Java Code:
    <filter>
      <filter-name>MY Filter</filter-name>
      <filter-class>com.filter.MyFilter</filter-class>
      <init-param>
        <param-name>keyStore</param-name>
        <param-value>../../config/filterConfigs/keystore.jks</param-value>
      </init-param>
    </filter>
    however, the filter cannot locate this file.
    If I specified the absolute path, it will be pick it up.
    so, how do i specify the relative path?

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default Re: specify relative path to file in web.xml

    I'm not extremely familiar with Tomcat, but have seen something similar with other web containers in that the path cannot be found unless relative to the currently running JRE - so I'd say find where this is within Tomcat and place the file path relative to that directory.

  3. #3
    trevMD is offline Member
    Join Date
    Apr 2012
    Posts
    5
    Rep Power
    0

    Default Re: specify relative path to file in web.xml

    wish i could do that. the folder contains Fedlet SSO configuration, keystore, etc.. and other stuff that multiple webappp uses.

    I saw somewhere where someone use something like <param-value>home/tomcat/mydirectory</param-value>.
    this is the ideal solution, but i'm not sure how to go about it.

Similar Threads

  1. Help needed to load relative path of file
    By friendz_forever in forum New To Java
    Replies: 8
    Last Post: 08-15-2011, 10:03 AM
  2. FileInputStream with relative path in a JAR
    By Bertieboy7 in forum New To Java
    Replies: 3
    Last Post: 03-31-2011, 04:10 AM
  3. How to use a relative path for a file?
    By kipade in forum SWT / JFace
    Replies: 0
    Last Post: 02-28-2011, 06:37 AM
  4. how to set relative path in jsp?
    By makpandian in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 01-02-2009, 08:20 AM
  5. Obtaining relative path outside of executable JAR
    By tjsaker in forum Advanced Java
    Replies: 1
    Last Post: 11-14-2008, 06:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •