permaculture playing cards*
The moose likes JSP and the fly likes Forwarding the current page to previous page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Forwarding the current page to previous page" Watch "Forwarding the current page to previous page" New topic
Author

Forwarding the current page to previous page

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
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

Joined: Jan 08, 2009
Posts: 1473
    
    6

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.


Swastik
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
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

Joined: Jan 08, 2009
Posts: 1473
    
    6

What exactly do you want? Only a window will appear without any frames?
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
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

Joined: Jan 08, 2009
Posts: 1473
    
    6

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

Joined: Oct 04, 2007
Posts: 518
I have used send redirect too.But the second frame is not yet closed
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1473
    
    6

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

Joined: Oct 04, 2007
Posts: 518
Thanks.It works fine in internet explorer.But in mozilla,It displays the stop page instead of start page
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1473
    
    6

You mean after execution of the servlet, in mozilla its behaving differently with the same redirect url from servlet?
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1473
    
    6

Apart from that I dont find any use of history.forward and document.write in your code.
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Forwarding the current page to previous page