maven classpath and WEB-INF

WebContent------- webapps下的项目名(项目工程名,不是包名),例如:ROOT(Tomcat的页面)
           |------静态页面(HTML、CSS、JS、图片)---静态页面,放在此处可以直接通过资源名访问
           |------JSP页面
           |------WEB-INF----如果有servlet或者JSP则此目录必须有
           								(里面的内容不直接提供对外访问)
                  |-----web.xml(必须的)------出现WEB-INF则必须有web.xml,web 2.5+可省略这个,
		                使用注解替代配置信息(例如:@WebServlet),
		                  全用注解效率不高,推荐替代部分配置信息
                  |-----classes(可选的)-----自己写的java类的class文件,没有源代码,
		                 Eclipse里发布项目时会自动创建, 并将字节文件导入到该文件夹下,
		                 还有自己写的配置文件
                  |-----lib(可选的)-----例如,数据库第三方jar包,引用了java类或者第三方jar包

Those who can access resources on the client ( HTML or .jpg) must be followed by WEB-INF in the same directory, that is placed in the root directory of Web resources (WebContent), from the client can be accessed directly through the URL address.

Published 41 original articles · won praise 1 · views 4713

Guess you like

Origin blog.csdn.net/tomorrow_shoe/article/details/98240321