Clarification in Java Package structure -


i have add filter in web.xml of web app uses directory structure in jar file i'll adding lib directory of web app.

<filter>                 <filter-name>monitor</filter-name>                 <filter-class>com.student.compute</filter-class>         </filter>         <filter-mapping>                 <filter-name>monitor</filter-name>                 <url-pattern>/*</url-pattern>         </filter-mapping>  

here filter using "compute" class com.student package in jar file. have expanded jar file , have confirmed whether structure exists.

now in classes directory have com directory houses many classes specific application.

now won't com in jar file , com in classes directory clash when try access content in web application.

please clarify.

no, won't clash. if problem, couldn't use several libraries from, fo example, apache @ same time, because put classes under sub-package of org.apache.

you can see package tree of classes in classpath giant tree containing merge of package trees of jars , directories listed in classpath.

if had 2 classes exact same package , name in 2 different jars/directories in classpath, problem, because first 1 available, , can't (afaik) have guarantee order of web-inf/classes , jars under web-inf/lib in classpath.


Comments