I am deploying a web application in a Jetty container and I need to know how to add a classpath for Jetty to be able to load resources from a testing directory.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
I think it’s best to not modify the Jetty CLASSPATH; use what you know about the defaults for your web app.
All the JARs in WEB-INF/lib are your web app’s CLASSPATH; so are all paths relative to WEB-INF/classes. If you put a directory /test-resources under WEB-INF/classes and load it as a resource stream from the context you’ll be able to access those test files without having to alter the Jetty startup scripts.