• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Forwarding the current page to previous page

 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

my first page in my project is a jsp page which selects a network and clicking start button,a dialing process will happen through a servlet which forwards to a jsp page in one frame which selects a network and a stop button and another frame displays which network is selected.if i stop the button in the first frame,the selected network should be stopped and the two frames should be closed and open the jsp page which is used to start the network.
The following code stops the network selected and closes the two frames.But it oens the jsp page which stops the network.

How should i forward the page or redirect the page to the start page.

Thanks in advance
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks to me that StopServlet is doing the required functionality, so from this servlet forward the request to the page where ever you want.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.I have already tried like that.But The changes are made only in the top frame.The second frame still appears
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly do you want? Only a window will appear without any frames?
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what i exactly need is on clicking the stop button,the selected network should be stopped and the two frames should be closed and the main page should be displayed again.

Thanks
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From StopServlet instead of using forward action, use sendRedirect to the main page that might solve the problem, provided you dont have any scoped attribute values set.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used send redirect too.But the second frame is not yet closed
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should work now, in java script instead of location.href use parent.location.href

i.e.

your present code is

location.href=locationRequest;

try with

parent.location.href=locationRequest;
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.It works fine in internet explorer.But in mozilla,It displays the stop page instead of start page
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean after execution of the servlet, in mozilla its behaving differently with the same redirect url from servlet?
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from that I dont find any use of history.forward and document.write in your code.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot .Now its working fine in mozilla too.
instead of using stop as ahref ,I changed stop as button.Now it is working fine.


Thanks again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic