用session,举例说明:
String id=(String) session.getAttribute("id");
如果id的值为空,就是没有登陆
String id=(String) session.getAttribute("id");
如果id的值为空,就是没有登陆
解决方案 »
- md5crypt 密码验证问题????????
- 寻类似Jfreechart的一个图形报表,具体请看内容
- 一个servlet转发的难题,高手帮忙!!!
- 查询msn帐号是否联机
- 一个类中,能不能调用servlet用的context对象?
- 一个jsp错误处理页面的问题
- 赋值问题
- 在servlet中调用同一个类中两个方法,一个正常,另一个出现:java.lang.NoClassDefFoundError!请问是什么原因呢?谢谢!
- 急,在线。。。。。。。。。。。。。。。。
- EOF after reading only: '0' of: '1047' promised bytes, out of which at least: '
- 用JSP实现一个生成随机数的函数怎么写?有吗?
- 求助:JSP中文字符转换问题?
if(id==null){
//未登录}
else{
//登录}
用来判断用户是否已经连上服务器?
setAttribute("maname","cheery"),getAttribute("maname");对马?
中得"id"我固定得变量还是可以随便修改得呢,比如换成name,当然要setAttribute("name","cheery"),与之相配
if(getloginmessage!="ok"){
%>
<jsp:forward page="false.jsp">
<%
}
%>
if(登陆)
{b=true;out.print("登陆")}
getAttribute("id");里面得id只是一个变量名,也可以换成
setAttribute("maname","cheery"),getAttribute("maname");