日期:2014-05-19 浏览次数:20846 次
HttpSession session = request.getSession(true);
session.setAttribute(Constant.USER_SESSION, user);
ServletContext context=session.getServletContext();
context.setAttribute("session", session);
HttpSession session=request.getSession();
ServletContext Context=session.getServletContext();
ServletContext Context1=Context.getContext("/A");
if(Context1 !=null && !Context1.equals("")){
HttpSession sess =(HttpSession)Context1.getAttribute("session");
User user=(User)sess.getAttribute(Constant.USER_SESSION);
if(user!=null)
System.out.println("username:--------"+user.getUserName());
}
java.lang.ClassCastException: com.nodoor.vo.User cannot be cast to com.nodoor.vo.User