The introduction of the jquery plugin in the JSP page is mainly the path problem introduced below, there are three ways:
1 . Create the JSP file directly under the Wetroot, put the jquery-1.7.js into a new folder: as shown:
The code to introduce jquery in index.jsp is: in the head [JavaScript] view plain copy print? 2 Create a new folder under Webroot Jsp,jquery-1.7.js put it under a new folder: Figure:
The code to introduce jquery into myname.jsp is: [JavaScript] view plain copy print? 3. Useful but not recommended solution fill in the following code at the top of the JSP file
When you introduce jquery, fill in the following code:
[JavaScript] view plain copy print? <script type= "Text/javascript" src= "<%=basepath%>/plugins/jquery/jquery-1.7.js" > the file structure at this time is like 2.
Reference source above: http://blog.csdn.NET/zjplovemm/article/details/21109109
Of course, you can also directly introduce an absolute path.
But today I encountered a problem, I used all the above methods to introduce failure, return 404 error.
Why , why? Later remembered that I use is SPRINGMVC, in the configuration time may affect to the static file use, like JS, CSS.
So I checked, and one of my brothers met the same problem as me: http://www.cnblogs.com/dscs/p/5043993.html
According to his method,
Add in SPRINGMVC configuration file
<mvc:annotation-driven/>
<mvc:default-servlet-handler/>
It's OK.
Problems to consider overall 、、、 will not be affected by other issues