我写了一个jsp项目,试图执行它。我收到了这个错误:
listType无法解析为变量
所以我将这些行添加到我的jsp文件中:
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
但它没有解决问题。我该如何解决? 还有一个这样的错误:
未定义类型的StudentDetails()方法 MangeUser Student.jsp
这是Student.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="com.junos.users.MangeUser"%>
<%-- <%@ page import="com.junos.userdetails.UserEntityDetails"%> --%>
<%@include file="menu.jsp" %>
<%@page language="java" import="java.util.*,java.io.*,java.sql.*"%>
<%!int skillLevel_id=0;%>
<jsp:useBean id="Student" class="com.junos.users.MangeUser" />
<jsp:setProperty name="Student" property="*" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> Users </title>
<link href="<c:url value="/resources/data-tables/css/jquery.dataTables.css" />"
rel="stylesheet" type="text/css" />
<script src="<c:url value="/resources/data-tables/js/jquery.dataTables.js" />"type="text/javascript"></script>
<link href="<c:url value="/resources/bootstrap-select/css/bootstrap-select.min.css" />"
rel="stylesheet" type="text/css" />
<script src="<c:url value="/resources/bootstrap-select/js/bootstrap-select.min.js" />"></script>
<style type="text/css">
.bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
width: 218px;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#usrTable').DataTable();
$('#UserDiv').hide();
$('#tblsDiv').hide();
$('#challenegrDescriptionDiv , #Image ').hide();
$('#addUser').click(function(){
$('#UserDiv').show();
$('#usrTbl').hide();
});
$('.cncl').click(function(){
$('#usrTbl').show();
$('#UserDiv').hide();
});
});
var roleValue = function(){
var val = $('#userRole_id option:selected').text();
if(val == "WAITER"){
$('#tblsDiv').show();
}else{
$('#tblsDiv').hide();
}
if(val == "CHALLENGER"){
$('#usrnmDiv , #passDiv , #cnfrmPassDiv').hide();
}else{
$('#usrnmDiv , #passDiv , #cnfrmPassDiv').show();
}
if(val == "CHALLENGER"){
$(' #Image , #description').show();
$('#challenegrDescriptionDiv , #Image ').show();
}else{
$(' #Image , #description').hide();
$('#challenegrDescriptionDiv , #Image ').hide();
}
}
</script>
<script type="text/javascript">
function PreviewImage() {
alert("PreviewImage");
var oFReader = new FileReader();
oFReader.readAsDataURL(document.getElementById("profileImage").files[0]);
oFReader.onload = function (oFREvent) {
document.getElementById("imagePreview").src = oFREvent.target.result;
};
};
</script>
<script type="text/javascript">
//getting value of radio button
$(document).ready(function(){
$("input[type='radio']").click(function(){
var radioValue = $("input[name='name']:checked").val();
if(radioValue){
alert("Your are a - " + radioValue);
}
window.location='EditList.jsp?radioValue='+radioValue;
});
});
</script>
</head>
<body >
<div class="container">
<div class="row-fluid">
<div id="UserDiv" class="col-md-8 col-md-offset-2">
<div class="well well-sm">
</div>
</div>
</div>
</div>
<div id="usrTbl" class="col-md-10 col-md-offset-1">
<div class="btn-group" style= "margin-bottom: 10px;">
<button id="addUser" class="btn btn-success" style="margin-left: 10px;">
<span class="glyphicon glyphicon-plus-sign"></span>
</button>
<button class="btn" style="background-color: #9933CC; color: white;margin-left: 10px;">
<span class="glyphicon glyphicon-edit"></span>
</button>
<button class="btn btn-danger" style="margin-left: 10px;">
<span class="glyphicon glyphicon-trash"></span>
</button>
</div>
<table id="usrTable" class="display text-center table-bordered table-striped" cellspacing="0" width="100%">
<thead>
<tr>
<th class="text-center">First Name</th>
<th class="text-center">Last Name</th>
<th class="text-center">User Name</th>
<th class="text-center">Password</th>
<th class="text-center">Mobile Number</th>
<th class="text-center">Email Id</th>
<th class="text-center">Challenger Description</th>
</tr>
</thead>
<tbody>
<%
List<MangeUser> userList= Student.StudentDetails();
System.out.println("userList size: " + userList.size());
pageContext.setAttribute("Users", userList);
%>
<c:forEach items="${Users}" var="user">
<tr>
<td><c:out value="${user.firstName}"/></td>
<td><c:out value="${user.lastName}"/></td>
<td><c:out value="${user.username}"/></td>
<td><c:out value="${user.password}"/></td>
<td><c:out value="${user.mobileNumber}"/></td>
<td><c:out value="${user.emailID}"/></td>
<td><c:out value="${user.challengerDescription}"/></td>
</tr>
</c:forEach>
</tbody>
</table>
<%@include file="footer.jsp" %>
</div>
</body>
</html>
如何修复这2个错误?