under a Java Webapp,
I want to set /WEB-INF/lib to D:/somepath/lib
and /WEB-INF/classes to E:/somepath/classes
and web.xml to F:/somepath/config.xml
how to config these under tomcat or jetty to change the convention?
under a Java Webapp,
I want to set /WEB-INF/lib to D:/somepath/lib
and /WEB-INF/classes to E:/somepath/classes
and web.xml to F:/somepath/config.xml
how to config these under tomcat or jetty to change the convention?
The specification (Java™ Servlet Specification Version 2.3) only mentions standard folders:
The web application classloader must load classes from the WEB-INF/classes directory first, and then from library JARs in the WEB-INF/lib directory.
With Tomcat or Jetty you cannot do it with "out-of-box" provided functionality:
WebappX — A class loader is created for each web application that is deployed in a single Tomcat instance. All unpacked classes and resources in the /WEB-INF/classes directory of your web application, plus classes and resources in JAR files under the /WEB-INF/lib directory of your web application, are made visible to this web application, but not to other ones.
The normal configuration is for each web context (web application or war file) is given it's own classloader, which has the system classloader as it's parent. Such a classloader hierarchy is normal in Java, however the servlet specification complicates the hierarchy by requiring that:
Classes contained within WEB-INF/lib or WEB-INF/classes have priority over classes on the parent class loader. This is the opposite of the normal behaviour of a java 2 class loader.
However, you can:
Cheers
On a Unix system you could do this manually by setting up soft links from the expected places to the locations on the other disks.
Both application servers you mention are open source, so you could write your own version of them. I guess the part that implements the classloader for a web app is what you would have to change.
But if you must engage in such shenanigans, you should suspect that you have made a wrong decision earlier. I can think of no good reason to do what you want to do.