请问怎样用jsp做用户login程序,用session吗,那为有sample

goldentree 2001-07-11 01:56:08
...全文
192 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
syz 2010-06-09
  • 打赏
  • 举报
回复
可以设置SESSION过期时间吧?
cattiger 2002-05-09
  • 打赏
  • 举报
回复
关注
关注
kobe_lee 2001-07-18
  • 打赏
  • 举报
回复
我是说非正常!比如停电、直接关浏览器或跳转到其他网站!
怎么会触发这个方法呢?
wcarry21 2001-07-17
  • 打赏
  • 举报
回复
removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this session.
kobe_lee 2001-07-14
  • 打赏
  • 举报
回复
用Session做用户认证是有个问题在CSDN这里几乎一直没有人能给出解决方法。
就是用户非正常退出,SESSION仍然保留了下来,如何处理???!!!
backlove 2001-07-13
  • 打赏
  • 举报
回复
当然用session
dule_yu 2001-07-13
  • 打赏
  • 举报
回复
用不用session是什么意思?
客户端与服务器端交互就会产生一个session,
建义将用户ID放入session中进行传递
nintyuui 2001-07-13
  • 打赏
  • 举报
回复
可以用SESSION
<%@ page import="java.lang.*" %>
<%@ page import="java.io.*" %>
<%@ page import="javax.rmi.PortableRemoteObject" %>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="commonHome" %>
<%@ page import="commonRemote" %>

<%-- String Error_message= req.getParameter("error");--%>
<%
commonRemote common;
InitialContext ic = new InitialContext();
Object objref_find = ic.lookup("java:comp/env/ejb/common");
commonHome home_find=(commonHome)PortableRemoteObject.narrow(objref_find,commonHome.class);
common=home_find.create();

//HttpSession session = request.getSession(true);
session.setAttribute("common",common);
%>
<html>
<head>
<title>用户登录</title>
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=GB2312">
</head>
<body>
<center>
<form name=form1 action=update method=post>
KONICA PARTS SYSTEM
<p>
用户登录
<p>
<%
String Error_message=request.getParameter("error");
if (Error_message!=null)
{
%>
错误信息:<%=new String(Error_message.getBytes("gb2312"),"8859_1")%>
<%
}
%>
<p>
<table border>
<tr>
<td>用户号</td>
<td><input name=code value=""></td>
</tr>
<tr>
<td>密码</td>
<td><input name=password value=""></td>
</tr>
<tr>
<td><input type="submit" value="更新"></td>
</form>
<form name="form2" action="register" method="post">
<td><input type="submit" value="注册"></td>
</form>
<form name="form3" action="special_register" method="post">
<td><input type="submit" value="特殊用户注册"></td>
</form>
</tr>
</table>
</center>
</body>
</html>
byfree 2001-07-11
  • 打赏
  • 举报
回复
http://go4.163.com/~blueski/
下个虚拟小龙亭去看看

81,114

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧