我为Web编写了一个jsp文件,并使用了tomcat 8.5。 但是,桌子没有按照我的意愿出来。 零件正确出来,但是即使没有框架,零件也完全是空的。
这是下面的代码。
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ page import="java.sql.*,enrollBean.*, Attendance.*"%>
<!DOCTYPE html>
<html><head><title> </title></head>
<body>
<%@ include file="top_project.jsp"%>
<% if (session_id == null) response.sendRedirect("login.jsp"); %>
String c_id= request.getParameter("c_id");
<table width="75%" align="center" border> <br>
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
<th>6</th>
<th>7</th>
<th>8</th>
</tr>
<br>
<jsp:useBean id="att" class="AttendanceBean.AttendanceBean"/>
<jsp:useBean id="enrollMgr" class="enrollBean.EnrollMgr" />
<%
Vector vlist = enrollMgr.getEnrollList(session_id);
int counter = vlist.size();
Vector vlist2 = att.getAttendanceList(session_id,<%=en.getCId()%>);
int counter = vlist2.size();
%>
<tr>
<td align="center"><%=en.getCId()%></td>
<td align="center"><%=en.getCIdNo()%></td>
<td align="center"><%=en.getCName()%></td>
<td align="center"><%=en.getCUnit()%></td>
<td align="center"><%=en.getCId()%></td>
<td align="center"><%=en.getCIdNo()%></td>
<td align="center"><%=en.getCName()%></td>
<td align="center"><%=en.getCUnit()%></td>
</tr>
</table>
</body>
</html>
请帮助我解决此错误。
答案 0 :(得分:0)
至少在JSP / HTML源代码中存在以下错误:
- name: Loop through example servers and show the hostname, ansible_host attribute
debug:
msg: "ansible_host attribute of {{ item }} is {{ hostvars[item]['ansible_host'] }}"
when: ansible_host == hostvars[item]['ansible_host']
loop: "{{ groups['servergroupexample'] }}"
应该用String c_id= request.getParameter("c_id");
括起来。<% ... %>
和<br>
之间不允许<table>
。<tr>
和<br>
之间不允许</tr>
。变量<tr>
是在en
中引入的吗?