这条错误提示是什么意思啊?谢了. 空指针,是不是你的JSP中间用到了没有初始化的对象? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public boolean checkSessionBean(HttpServletRequest request,String strSessionName,String strCheckValue){//public boolean checkSessionBean(HttpServletRequest request){HttpSession session = request.getSession(false);//return(bolCheckPass);// session.setAttribute("sesUserRole","user"); if (strSessionName==null || strCheckValue==null){return(bolCheckPass);}else{if (session!=null && session.getAttribute(strSessionName)!=null){bolCheckPass=session.getAttributestrSessionName).equals(strCheckValue);}return(bolCheckPass);}}//session.setAttribute("sesUserRole","user"); 这一条语句加了就出错,出现上面的提示... 当然出错了,你看代码Session session=request.getSession(false);这个意思就是说要获得这个用户的Session,假如有便给他,假如没有也不新建一个给他,看Doc就是这样,没有那么返回null,所以才会出现空指针,改为session=request.getsession(true),或是不要参数,默认为true struts标签lable属性无法显示 谁有java ee sdk中文版chm帮助文档啊 fusioncharts柱状图,如何设置每个柱子的宽度 Spring配置文件的一些疑问 找到一款套打、连续打印、分页打印报表控件 jsp如何显示数据库中的数据 如何控制session的有效时间? 我想把一个INT类型的数据放到SESSION中,我应该怎么做呢?怎么存取呢(在线等待,急!) jsp 服务器无法正常启动??? 大家在项目中的短信发送是使用的那种方式(1短信猫 2第三方短信平台) jbuilder里面怎么不能生成HTML页面啊? 简单问提一个!
//public boolean checkSessionBean(HttpServletRequest request){
HttpSession session = request.getSession(false);
//return(bolCheckPass);
// session.setAttribute("sesUserRole","user");
if (strSessionName==null || strCheckValue==null){
return(bolCheckPass);
}else{
if (session!=null && session.getAttribute(strSessionName)!=null){
bolCheckPass=session.getAttributestrSessionName).equals(strCheckValue);
}
return(bolCheckPass);
}
}
//session.setAttribute("sesUserRole","user"); 这一条语句加了就出错,出现上面的提示...
这个意思就是说要获得这个用户的Session,假如有便给他,假如没有也不新建一个给他,看Doc就是这样,没有那么返回null,所以才会出现空指针,改为session=request.getsession(true),或是不要参数,默认为true