Recently do a project, in writing backstage, encountered a problem, first in the JSP introduced Bootstrap and Bootstrap-validator (form verification), encountered a problem, is in the runtime, the error
You are prompted to write JS, there is no this method, but bootstrap in the introduction of the JS,CSS are introduced, why also want to report this mistake, and then slowly wrong, finally found the root cause,
In my JSP interface, I have introduced other files:
But there's nothing wrong with the label, the problem is not here, open this include-navbar.jsp file to see, the focus here:
I introduced the jquery library in this JSP interface, but look at one of our previous interfaces,
Visible, the JSP interface also introduced jquery, which led to the secondary JSP interface in the <jsp:include page= "/web-inf/jsp/include-navbar.jsp"/> introduced in the JSP interface, also with jquery , and the main interface into the conflict, resulting in an error: Uncaught typeerror: $ (...). Bootstrapvalidator is not a function
The solution: to introduce the jquery in the JSP interface introduced by the label <jsp:include .../> (include tag introduced to the jquery library directly using the main interface).
PS: When using Bootstrap-table, the method that needs to be used----$ (' table '). Bootstraptable (' methods '); is also true.