This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes can a servlet response multiple times to single request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "can a servlet response multiple times to single request" Watch "can a servlet response multiple times to single request" New topic
Author

can a servlet response multiple times to single request

Em Aiy
Ranch Hand

Joined: May 11, 2006
Posts: 226
as the title explains, is there any way that i can response multiple times to single request.

Scenario,

On request from my page, the request goes to servlet, servlet response to some particular information and then start proceeding to implement the other logic after the end of the logic, it has to response again to that requested page. But How?

Uptill now i am unable to implement this thing and using an alternate way to do that which is actuall not a way ...


The difference between <b>failure</b> and <b>success</b> is often being <b>right</b> and being <b>exactly right</b>.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

No, there is only one response per request.
This is how HTTP works.

What are you trying to do?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Em Aiy
Ranch Hand

Joined: May 11, 2006
Posts: 226
ahan, actually i want to display "please wait message" on report download request. I also want that if there is some problem then there should be some message writen in that POP-UP that there is some problem, please try again.

how can i ?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
What Ben said about one request/one response is absolutely correct. However, there are some tricks that can be employed to start another thread for a long-running process, display a wait message, and then monitor that thread.

This link gives one method for doing this. There are others. Just do some searching on the web.


Merrill
Consultant, Sima Solutions
Em Aiy
Ranch Hand

Joined: May 11, 2006
Posts: 226
emm thanks. i tried to do some searching but can't find what i was looking for. That's why i thought to ask here.

I guess i need to search again. Thanks again!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can a servlet response multiple times to single request
 
Similar Threads
Multiple response for a request
One clarification needed regarding Servlet
how to prevent double clicks on hyper link.
Web Transaction
Multiple requests to download files using JavaScript