Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP handling TCP packets

Nikolai Ivanov
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
i wish you happy new year.

when you become sober please try to help.

here is the problem.

There is an html page that loads google maps and people can add vehicles on the map. then the javascript sends ajax to a jsp page every n seconds and waits to get back the new coordinates and then update the map.

So here is the core of the problem.

I have written code that makes endless loop and gets the new vehicles from TCP socket and stores them in arrays;

So how do i make the jsp page runs this code all the time AND at the same time work on the AJAX request and when it gets visited it takes the parameters javascript code sent it and if the parameters are

car_id = R007
latitude = x
longtitude = y

find this car_id in the arrays and take the latitude and longtitude and writes it back to the client so the javascript can update the google map.

This is going to be used by many people so i need a way to make the jsp page receives the packets in the background and when a new request comes in to handle it.

10x in advance


i tried to override the jspInit() method and run the code that gets the TCP packets but as i said it uses ENDLESS loop so the jsp page NEVER LOADS completely. It waits until the jspInit() method finish executing.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic