Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] reading property file from servlet context file

hi all,

I am a new user in jetty and i moved my existing web application from tomcat to jetty.
this is the structure:
- myWebapp/
  - src/
    - main/
      - java/ (java source files)
      - webapp/
        - index.html
        - WEB-INF/
          - web.xml
          - etc/
            - config.xml   

in the pom file i specified everything in order to run the jetty plugin (which works). 
After deploying i get the following structure
- myWebapp/
  - src/
  - target/
    - <my>SNAPSHOT/ 
      - index.html
      - WEB-INF
        - web.xml
        - lib/
        - classes/ 
        - etc/
          - config.xml 

The html page is visible, but I have problem when reading 
the configuration file.
I access from my servlet class to the path via: 
which returns as String: 
and this is not equal to my desired path
But this is not the path, in which my configuration file is stored?

I just see in <absolutePath>/myWebapp/target/war/work/webapp-cache.xml
in which the property <string>WEB-INF/etc/config.xml</string> occurs.

Any idea what I am doing wrong or should i access to the config file in a different way?

may thanks


This is the relevant part of my pom:


Now i have problems in reading my configuration file.

Back to the top