Path problem Java Web front-end resource file

WEB-INF directory is secure Java Web application, used to store class files when you deploy the project to use the library (jar package), Java Web application configuration file web.xml.

Browser can not access resources in this directory, such as in the WEB-INF delegated some pictures, and then in the jsp using <img> to show these pictures are not show up. Access to resources under WEB-INF with <a> link or URI, direct displays an error page.

 

 

Front page pictures and other resources used, usually in the web create a new folder, put inside.

 

 

When referencing resources (css, js, image, jsp) under the web, write directly to the path, without the web.

<img src="image/荷花.jpg">

<a href="login.jsp">登录</a>

Guess you like

Origin www.cnblogs.com/chy18883701161/p/12108751.html