In the case of non-spring MVC blocking "/":
Web-inf is protected and cannot be accessed directly
Here's how to fix it
<c:set value= "${pagecontext.request.contextpath}" var= "path" scope= "page"/>
<script type= "Text/javascript" src= "${path}/js/jquery-1.8.1.min.js" ></script>
<script type= "Text/javascript" src= "${path}/js/jquery.datepick.js" ></script>
<script type= "Text/javascript" src= "${path}/js/jquery.datepick-zh-cn.js" ></script>
<link type= "Text/css" href= "${path}/css/smoothness.datepick.css" rel= "stylesheet" >
First, there is no need for css/js/html to be placed under Web-inf.
eventually these will be displayed intact on the client side, so access security is not a problem at all. The
JSP is placed under Web-inf for the main reason that there are two
1. The ancient pattern will be the business logic, database connection and other sensitive information written in the JSP, the user directly access will have security problems.
This is no longer a problem in modern mode and should not be a problem.
2. JSP is running on the server side, and usually requires other program support-such as the background processing of data to allow JSP rendering and so on, the user directly access a meaningless, two will throw exception, these are wasted server resources.
Second, if you must put it under Web-inf. The
requires a servlet to forward, or read the file and write it on the response.
If it is spring, you can refer to the
http://static.springsource.org/spring/docs/current/spring-framework-reference/html/ mvc.html
17.15.6 Configuring serving of resources