我的app.jsp文件是这样的:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="imgs/ano_white.png">
<title>Home - Hackeet</title>
</head>
<body>
<div class="container">
<div class="mainCont"></div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="js/register.js"></script>
<script src="js/app.js"></script>
</body>
</html>
我对AJAX的文件调用是这样的:
$('.mainCont').load('register');
我的JSP文件是:
<input list="teams" name="team" placeholder="Team Name">
<datalist id ="teams">
<c:forEach items="${teams}" var="team">
<option value="${team}"></option>
</c:forEach>
</datalist>
Chrome开发工具的退出:
<c:foreach items="[Stratagee, The Best Team (TBT), Alex_peroGriego_TEAM, Excella]" var="team">
<option value=""></option>
</c:foreach>
如您所见,正确引入了元素,但是foreach无法正常工作。
答案 0 :(得分:0)
已解决,我包括这个:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
在register.jsp文件中,所有作品