File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes control after redirecting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "control after redirecting" Watch "control after redirecting" New topic

control after redirecting

mahadev ramalingam

Joined: Jan 15, 2002
Posts: 12
I've a jsp page pageOne.jsp...
from that, I'm redirecting to pageTwo.jsp...
after that, I want the control back to pageOne.jsp!!!
I know that its not possible...still tried for that...
moreover, my pageTwo.jsp is redirecting to pageThree.jsp...
I need the control back in pageOne.jsp...i.e...after redirecting to pageTwo, I've some more statements to be executed...
Is there any other way to do this?
using threads...or any other way...pls help...
I tried forward and include instead of redirecting...but they're not working...
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
I think you need to redesign your application if the present structure is causing so much trouble. Back off a bit, forget your existing structure, and try to define what the application is supposed to look like to a user.
Throwing away a great tangled mess of code and starting over happens all the time in any language.
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
You may consider using an Include, so that the second page code gets executed in the middle of the first page code.

Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
Ken Robinson
Ranch Hand

Joined: Dec 23, 2003
Posts: 101
I suggest using only display logic in your JSP.
Have a servlet do all of the work such as business calls, JDBC calls, EJB calls and such. Have the JSP only display the results. Using JSTL, you can import other page 'bits' to allow the logic to reside in one file and have that piece of a page displayed anywhere the <c:import> is used.
Having display and logic in the same tier/file is not popular for many reasons with your problem being one of the main issues.
mahadev ramalingam

Joined: Jan 15, 2002
Posts: 12
Using include didn't work as it needs some credentials from my browser which, I could get only from sendRedirect.
May be I need to rethink on my design.
I agree. Here's the link:
subject: control after redirecting
It's not a secret anymore!