-1

I'm writing a chess game by servlets and jsp pages. here is my problem:

when the player 1 move his/her nut I wanna update the player 2's jsp page that player 2 could see the the move of player one. tnx

KV Prajapati
  • 93,659
  • 19
  • 148
  • 186

2 Answers2

0

It's a pretty broad issue. One thing you can use is polling (using Ajax). This way, both the browsers will poll the web server and get the latest state of the game. The UI can be refreshed appropriately using JavaScript.

A more traditional approach is specifying the meta element which will refresh the page periodically.

<meta http-equiv="refresh" content="600"> 
Sid
  • 4,893
  • 14
  • 55
  • 110
0

You have to use comet framework (HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it) to develop such kind of application.

Take a look at Atmosphere Framework plugins and extensions that contains client and server side components for building Asynchronous Web Application.

KV Prajapati
  • 93,659
  • 19
  • 148
  • 186