+ Start a Discussion
Ankit Maini.Ankit Maini. 

Maintain the correct URL when forwarding the request.

I have a site with multiple pages and I am using request forwarding rather than sendRedirect, that means sendRedirect(false).
There's some weirdness where when an applicant goes to the next page, it loads the next page (correctly), but the URL up at the top of the browser still shows the URL value from the previous page (even though you are looking at the content from the next page).

I don't want to use the sendRedirect(false), Is there any solution to show correct URL when using sendRedirect(false)/Request Forwarding
Balaji Chowdary GarapatiBalaji Chowdary Garapati
@Ankit Maini,

  Im not sure how to answer this, but let me share my view on the question you have:

 Your question itsself has the answer, you do not want to use setRedirect(true), which means you are requesting for serverside redirect rather than client side redirect which preserves the current view state and url if you are using the same controllers for both the pages.,

If you need to get out of it, use two different controllers for the target page, which solves your problem or use setRedirect(true) {Both are one and same}

Im not sure why you were hesitating to use setRedirect(false) !? Can you help me understand why ? Were you trying to invoke any script or carry back any result from child page? (in that case why dont you consider using some URL parameters which can do that??)