【发布时间】:2016-10-26 09:14:12
【问题描述】:
这是我的代码。我尝试了很多。但找不到任何运气。我希望 ajax 响应以表格形式出现。
if (URI.endsWith("updateEmpById.action")) {
Employee emp;
try {
emp = new EmployeeDaoImpl().findEmployee(Integer
.parseInt(request.getParameter("val")));
out.print("<div>");
out.print("<form action='UpdateEmployee.action'><p> ID:<input type='number' name='id' value='"
+ emp.getId() + "' readonly></p>");
out.print("<p> NAME:<input type='text' name='name' value='"
+ emp.getName() + "'></p>");
out.print("<p> DESIGNATION:<input type='text' name='desig' value='"
+ emp.getDesignation() + "'></p>");
out.print("<p> SALARY:<input type='text' name='salary' value='"
+ emp.getSalary() + "'></p>");
out.print("<p><input type='button' value='Update' class = 'button'></p></form>");
out.print("</div>");
} catch (NumberFormatException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}
谢谢。
【问题讨论】:
-
如果您想输出为表格,请稍微学习一下 HTML。 tutorialspoint.com/html/html_tables.htm
标签: javascript java ajax