📄 processupdate.jsp
字号:
<%@ page language="java" import="com.buat.hr.institution.Institution,com.buat.hr.institution.InstitutionDAO" pageEncoding="gbk"%>
<%
String idstr=request.getParameter("id");
int id=0;
try{
id=Integer.parseInt(idstr);
}catch(Exception e){}
String name=request.getParameter("name");
String reason=request.getParameter("reason");
String explains=request.getParameter("explains");
Institution institution=new Institution(name,reason,explains);
InstitutionDAO dao=new InstitutionDAO();
boolean successful=dao.updateInstitution(institution,id);
String message="Congratulations!修改信息成功!";
if(successful==false)
message="Sorry!修改信息失败!";
%>
<html>
<head>
</head>
<body background="../bg.jpg">
<script type="text/javascript">
window.alert("<%=message%>")
<%if(message.equals("Congratulations!修改信息成功!")){ %>
window.location.href="Scan.jsp";
<%}else {%>
window.location.href="Update.jsp";
<%}%>
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -