I have a scenario, where I currently on the page (say: www.abc.com/forummodules/2010/abc/index.html) and then I click a url (say: www.abc.com/forummodules/2010/report.html?param1=xyz) and if the user is not logged in then he/she is redirected to login page (say: www.abc.com/forummodules/login) before being directed to actual url.
Now the in address bar it shows url: www.abc.com/forummodules/2010/report.html?param1=xyz but I am on login page actually.
I want that address in the url i.e www.abc.com/forummodules/2010/report.html?param1=xyz
when I do request.getRequestedURL() I get www.abc.com/forummodules/login?param1=xyz
doing javascript i can get that required address (using: window.location.href) but is there any way in java to achieve this
dp sharma wrote:Hi Jeanne,
Can you please describe it in more detail..
And without a typo that confuses matters ? Sure.
In MVC, you normally forward to a JSP. A servlet also lets you redirect to another URL. I was thinking you could forward from the URL you don't want to the one you do. Although now that I think about it more, I don't remember if a redirect actually changes the URL in the browser. I know if you press F5 (refresh), it submits to the second URL. I just don't recall what shows in the address bar.