aspose file tools*
The moose likes Servlets and the fly likes i want no reponse from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "i want no reponse from servlet" Watch "i want no reponse from servlet" New topic
Author

i want no reponse from servlet

Sid Sharama
Greenhorn

Joined: Feb 06, 2005
Posts: 11
hi,
in my application there is a link(href) and when it is clicked a servlet is invoked.now,i don't want any response from that servlet,it should just do some session tracking tasks.so, i didn't do anything with HttpServletResponse in doGet().
so, when i click 'href' it is giving the message - document contained no data.but servlet is doing the session tracking written in it.
any response is welcome. thank you
sri

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
Browsers expect to send a request and get a response, so its going to be tricky to get around that. Why don't you use an HTML FrameSet, with one Frame being hidden - your URL can specify the invisible Frame as the target of the response so it won't matter that there is no response.
Bill
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
The usual trick for this is to return the same page as the one which invoked the servlet, either by a redirect or by building the same page again. That way the browser/server interaction works as expected, but the user still sees the same page..


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Sid Sharama
Greenhorn

Joined: Feb 06, 2005
Posts: 11
thank you both.well! the problem was resolved using Response.sendRedirect() and a little bit of URLRewriting.
every doubt has an answer/answers and every answer leads to new doubt(s).
how can i make a frame invisible/hidden.is it by leaving the src attribute blank ?
correct me if i am wrong.
regards,
sri
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
You can make a Frame invisible by setting the size of the visible frame using 100%. It is a handy way to conceal an applet among other things.
Bill
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
hi sri (BMW)
can you drop the source code, how u solved the problem. i am awaiting for the response from you, as i am also facing the same problem. please help me.
thanks in advance
surya
------------------
 
 
subject: i want no reponse from servlet