login_process.jsp

来自「这是jsp论坛」· JSP 代码 · 共 34 行

JSP
34
字号
<%@page contentType="text/html;charset=GBK"%>
<%@page language="java" import="java.util.*"%>
<html>
<head>
	<title>登录检查</title>
</head>
<body>
<%
String guest=request.getParameter("userName").trim();
guest=new String(guest.getBytes("8859_1"));

if(guest.length()!=0)
{
	session.setAttribute("chatName",guest+"(用户)");
}
else
{
	out.print("<script>alert(\"请输入您的大名后再登录!\");window.location=\"login.jsp\"</script>");
}
synchronized(application)
{
	Vector UserName=null;
	UserName=(Vector)application.getAttribute("UserName");
	if(UserName==null)
	{
		UserName= new Vector(30,10);
	}
        UserName.addElement(session.getAttribute("chatName"));
	application.setAttribute("UserName",UserName);
	out.print("<script>window.location=\"chat.jsp\"</script>");
}
%>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?