File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes sending multiple mobile client requests to servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "sending multiple mobile client requests to servlet?" Watch "sending multiple mobile client requests to servlet?" New topic
Author

sending multiple mobile client requests to servlet?

sanjay khuntia
Greenhorn

Joined: Oct 01, 2008
Posts: 1
Hi all,
I am new to this forum and I am facing a problem. It is like- I have written some MIDlet application for Mobiles which sends HTTP post data to a servlet running on some address and the servlet takes the request data, processes them and gives back results as response. The data comes ok at device end if only one device sends request.But for multiple requests from multiple devices sent simultaneouly to the same servlet at the same location(URL), the results at each device end sometimes comes different and sometimes the results are not shown to the proper device which sent a differnt request. say, three mobile clients send 3 different requests, then at each device end the result should be different..but in my case, two showing same results and one showing different results...

How come the servlet handle each clients request separately so that each device gets the appropriate result according to its query..Is there any Multi threading can be done at servlet side so that it will handle each device request separately..

please keep in mind..i m new to servlet and Java stuff..please guide me how can oercome this situation so that the servlet can handle multiple client request separately for processing.

Or is there any code chnge should be done at my mobile device side to handle response...

Thanks and regards,
sanjay
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Sounds like you've run across the old thread safe servlets problem . This Article will help you out with some tips and tricks. I also recommend googling for thread safe servlets to find more


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sending multiple mobile client requests to servlet?