我遇到了加载资源的问题。我使用header.jsp获取相同的标头。有一些js和css,但我自己的js没有加载到它,但其他一切都加载。否则Bootstrap无法正常工作。
我的header.js在WEB-INF / view / fragments
中<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=uft-8">
<link href="<c:url value="/resources/css/bootstrap.min.css" />" rel="stylesheet"/>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="http://cdn.jsdelivr.net/jquery.validation/1.15.0/jquery.validate.min.js"></script>
<script src="http://cdn.jsdelivr.net/jquery.validation/1.15.0/additional-methods.min.js"></script>
<script href="<c:url value="/resources/js/bootstrap.min.js" />" type="text/javascript"></script>
<script href="<c:url value="../resources/js/validation.js" />" type="text/javascript"></script>
我在JSP中加入了标题<%@include file="../fragments/header.jsp" %>
我在spring-servlet.xml中也有这个标签<mvc:resources mapping="/resources/**" location="/resources/" />