wood burning stoves 2.0*
The moose likes Struts and the fly likes Handling the event (if exists) when the Struts instance stops or restarts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Handling the event (if exists) when the Struts instance stops or restarts" Watch "Handling the event (if exists) when the Struts instance stops or restarts" New topic
Author

Handling the event (if exists) when the Struts instance stops or restarts

Matias Emanuel Serrano
Greenhorn

Joined: Aug 08, 2011
Posts: 3
Hi, I'm having some troubles with my applicatin when a user is logged in and the instance is restarted. Obviously, the session don't survives the restart... but is there some way to send a message to the client (and maybe log out the client) when it's detect a server restart??

Thank you!!!
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

I'm not able to understand your problem can you please elaborate it more.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Rajkumar Katudia
Ranch Hand

Joined: Jul 28, 2009
Posts: 51
Matias Emanuel Serrano wrote:Hi, I'm having some troubles with my applicatin when a user is logged in and the instance is restarted. Obviously, the session don't survives the restart... but is there some way to send a message to the client (and maybe log out the client) when it's detect a server restart??

Thank you!!!



Never tried but I guess this might solve your problem

http://en.wikipedia.org/wiki/Push_technology


Please let us know what did you do finally to resolve this
Matias Emanuel Serrano
Greenhorn

Joined: Aug 08, 2011
Posts: 3
My problem it's very simple:
1- I have an Instance of my application running in the server.
2- Users can login and logout normally
3- I decide for some cause to restart my server (but there are some clients who are still registered when i do this)
4- When the application restarts, the clients that were logged in before the restart, wants to do something in the application.
5- In this point, my application throws a null pointer execption when i want to get some data from the session, because i haven't got a session due the server restarts.

What i want to do, is to handle the event (if exists) when the server is stopping, and close the sessions of the clients that are logged. With this, when the instance is running again, there are not clients logged in, and the problem is solved.
Matias Emanuel Serrano
Greenhorn

Joined: Aug 08, 2011
Posts: 3
Rajkumar Katudia wrote:
Matias Emanuel Serrano wrote:Hi, I'm having some troubles with my applicatin when a user is logged in and the instance is restarted. Obviously, the session don't survives the restart... but is there some way to send a message to the client (and maybe log out the client) when it's detect a server restart??

Thank you!!!



Never tried but I guess this might solve your problem

http://en.wikipedia.org/wiki/Push_technology


Please let us know what did you do finally to resolve this


I will try it... thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Handling the event (if exists) when the Struts instance stops or restarts