0

Session Invalidate causing desktop variable to null

asked 2015-04-14 13:52:21 +0800

Niks36 gravatar image Niks36
1

I am getting NPE whenever I am invalidating session. Below is my code

    System.out.println("Executions.getCurrent():"+Executions.getCurrent()); //Not null 


    ServletContext context = Sessions.getCurrent().getWebApp().getServletContext();
    Map<String,HttpSession> multipleSessionMap = new HashMap<String,HttpSession>();
    // code for putting session in map
        HttpSession httpSession=multipleSessionMap.get("session");
        httpSession.invalidate();
        System.out.println("Executions.getCurrent() :"+Executions.getCurrent()); //returns null
        Executions.sendRedirect("/success.zul");

I am getting Execution.getCurrent() before session invalidate call but after it sets to null.

Thanks for the help in advance.. Any help would be appreciated.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-04-22 08:51:19 +0800

echarish gravatar image echarish flag of Japan
1809 7
http://jp.linkedin.com/in...

Hello

I will suggest you to read through below link's as they will give you more clear understanding about cleanups http://books.zkoss.org/wiki/ZKDeveloper'sReference/Customization/InitandCleanup

prefer using SessionCleanup to do your session cleaning http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/SessionCleanup.html

Harish.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-04-14 13:52:21 +0800

Seen: 40 times

Last updated: Apr 22 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More