【发布时间】:2017-09-17 10:49:51
【问题描述】:
在这里,我从这个 JSP 向 Servlet 发送联系号码。单击按钮时,我想发送与该特定按钮关联的联系人编号。不知道怎么弄,求推荐方法。。。 另外,表格边框没有显示我尝试增加宽度和厚度仍然没有显示。
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!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=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>View Employee</title>
<style>
td
{
padding: 12px 20px;
margin: 8px 0;
}
th
{
padding: 12px 20px;
margin: 8px 0;
}
</style>
</head>
<body style="background-color:powderblue;">
<%@ include file="MenuBar.jsp" %>
<%@ page import="in.idk.service.ViewEmployee" %>
<%@ page import="java.util.List" %>
<%@ page import= "in.idk.model.Employee" %>
<table>
<tr>
<th width="119"><label>Employee_Name</label></th>
<th width="168"><label>Employee_Contact_No.</label></th>
<th><label></label></th>
</tr>
<%
ViewEmployee viewEmployee = new ViewEmployee();
List<Employee> list = viewEmployee.getListOfEmployees();
for (Employee e : list) {
%>
<tr>
<td width="119"><%=e.getEmployeeName()%></td>
<td width="168"><%=e.getEmployeeContactNo()%></td>
<td><form action="GetOneEmployee" method="post">
<input type="submit" value="Submit" ></form></td>
</tr>
<%}%>
</table>
</body>
</html>
【问题讨论】:
标签: java jsp servlets jakarta-ee arraylist