Pergunta

I am working on web based applications. Server : Tomcat Technology : Simple Jsp/Servlet/JQuery

I need to restart my server as an when new updates are there. And these changes are frequent almost every 1 or 2 day. I think to create some mechanism like I can say to every logged in user to save their changes and server will start in few minutes. (Timer will be there). Popup should be open though user is ideal.

Is there any direct way to do this so? Or I need to implement ajax call on every few seconds to server on every jsp page to check if any message is there on server???

Any idea will be appreciated. Thanks in advance.

Foi útil?

Solução

For the approach you are taking, I would suggest you to use Async Serlvets(Req. min Servlet API 3.0) or Apache Tomcat's comet technology(Kind of Async Servlet).

You will make ajax call on every page when it(page) loads(ajax onload() for eg.) to Async Servlet and will idle until response from server comes. This Async servlet should send Server Restart notification to all connected clients- whenever you trigger notification manually. Once ajax client gets notification, it will display the Warning(or user friendly message).

This will remove the need to make unnecessary polling to server after fixed internal - A big plus resource wise.

Personally I wont suggest this way, better get agreed on specific timeframe for deployment everyday(every two days) with clients and perform deployments in this time.

If you are from India- You must be aware about IRCTC website- Which is not available for train reservation every night for 1 hour.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top