在网页中输入id点查询,显示id和name,求怎么做??
如下图所示:我做好了输入name,显示id和name的
下面是java代码
public List<JspDepartment> getJspDepartment() throws
SQLException
{
List<JspDepartment> jspList = new ArrayList<JspDepartment>();
List<Department> departmentList = departmentManage.queryAll();
for (int i = 0; i < departmentList.size(); i++)
{
JspDepartment jspDepartment = new JspDepartment();
jspDepartment.setId(departmentList.get(i).getId());
jspDepartment.setName(departmentList.get(i).getName());
jspList.add(jspDepartment);
}
return jspList;
}
public List<JspDepartment> getJspDepartment(String departmentName)
throws SQLException
{
List<JspDepartment> jspList = new ArrayList<JspDepartment>();
List<Department> departmentList = departmentManage
.query(departmentName);
for (int i = 0; i < departmentList.size(); i++)
{
JspDepartment jspDepartment = new JspDepartment();
jspDepartment.setId(departmentList.get(i).getId());
jspDepartment.setName(departmentList.get(i).getName());
jspList.add(jspDepartment);
}
return jspList;
}
jsp代码:
<form action="tree2.jsp">
<p class="serial">编号:001</p>
<input class="serial"></input>
<p class="name">机构名:中队1</p>
<input name="name" class="name"></input>
<button id="edit">修改</button>
<button id=