?? changename.jsp
字號:
<html>
<head>
<title>用戶升級</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
String oldName = (String) session.getValue("Name");
String newName = ((String) request.getParameter("changeName"));
if (oldName == null || newName == null) {
out.print("<script>alert(\"錯誤操作!\");");
out.print("window.location=\"advanced.jsp\"</script>");
return;
}
newName = newName.trim() + "(過客)";
synchronized (application) {
Vector UserName=null;
UserName= (Vector)application.getAttribute("UserName");
UserName.remove(oldName);
UserName.addElement(newName);
application.setAttribute("UserName",UserName);
session.putValue("Name",newName);
}
synchronized (application) {
Vector outMessage=null;
outMessage= (Vector)application.getAttribute("Message");
if(outMessage==null)
outMessage= new Vector(30,10);
String outstr="系統公告:<font color=blue>"+oldName+"</font>改名為<font color=blue>"+newName+"</font>";
String str1="no";
String systemSpeak = "yes";
outMessage.addElement(str1);
outMessage.addElement(newName);
outMessage.addElement(str1);
outMessage.addElement(outstr);
outMessage.addElement(systemSpeak);
outMessage.addElement(str1);
application.setAttribute("Message", outMessage);
}
out.print("<script>alert(\"換名成功!\");");
out.print("window.location=\"advanced.jsp\"</script>");
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -