On 17/12/2014 10:38, Nan Ge wrote: > On Wed, Dec 17, 2014 at 4:07 PM, Mark Thomas <ma...@apache.org> wrote: >> >> On 17/12/2014 01:56, Nan Ge wrote: >> >>> And the directory structure looks like this: >>> F:\PROJECTS\MYAPP >>> ├─src >>> │ └─main >>> │ ├─java >>> │ └─webapp >>> │ └─WEB-INF >>> │ └─lib >>> └─target >>> └─myapp //this is my web application context root >>> ├─META-INF >>> └─WEB-INF >>> ├─classes >>> └─lib >>> └─mybiz //this folder contains classes extracted >>> from mybiz.jar >>> ├─META-INF >>> └─myapp >>> └─biz >> >> WEB-INF/lib is only ever scanned for JARs. Everything else is ignored. >> >> classes belong in WEB-INF/classes without the top-level "mybiz" directory. >> >> Mark > > > Yes, classes belong in WEB-INF/classes without any top-level > non-package-name directory is the standard deployment structure defined by > the servlet spec. > > What I really want to know is what the consequence will be if we set > scanAllDirectories=true
The consequences will be as specified in the documentation. > and the Jar Scanner assumes the folder to be an expanded JAR file(if the > META-INF sub-directory exists) ? It won't since "the folder" in this case is WEB-INF/lib which is not on the class path. > Could the classes within the expanded > JAR folder > be loaded by the web application class loader? Which part of "WEB-INF/lib is only ever scanned for JARs. Everything else is ignored." did you not understand? >> >> I see the logic behind the guess but it is wrong. This option won't work for > either of those directories. >> > > And which directories/classpath the document indicates when it saying "If > true, any directories found on the classpath will be checked to see if they > are expanded JAR files" , if it "won't work for either of those > directories"? As per the docs, scanAllDirectories applies to directories found on the class path not to WEB-INF/lib since it is not on the class path. (WEB-INF/lib/*.jar is on the class path and that is not a directory). Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org