Issues in redirect

I'am having issues redirecting users in a Java application. This is the scenario:

1. Old URL was www.app1.com hosted on JBoss Server. Application is built using JSP.
2. Now, we moved the app to a different server and had to change URL to www.app2.com.
3. When users use the old URL to access the application, instead of log-in page, we show a page with a simple message asking them to click on new URL.(This link is a simple href tag). We also ask them to save this new URL in their favourites which is how they access the application.
4. Now, when they click on the URL posted on the old server page, it redirects to the log-in page on new Server. They save this link in their favourites. The application works fine for that session. But when they access the application next time using the favourites, it opens login page on new Server, but doesnot let them access when they enter user-id and pwd.

This is the reason, when they clicked on the URL link on the old server for the first time, application opened up but the URL was something like this:

www.app2.com/?jsession........(some query string) and they saved this link. So, instead of saving www.app2.com, it also saved the query string.(some session id from old server).

Can anyoone suggest how to get rid of this issue.

P.S: First I used simple href html tag, then I used JSP redirect tag(in this case, it directly redirects without showing them the page on Old Server). But in both the cases, when new server page opens, it has this query string at the end. How can I get rid of this query string.

I know that I can get rid of it on the new server when they submit the page but I donot want to touch the code on new server.

abhilash nalla wrote: 4. Now, when they click on the URL posted on the old server page, it redirects to the log-in page on new Server. They save this link in their favourites. The application works fine for that session. But when they access the application next time using the favourites, it opens login page on new Server, but doesnot let them access when they enter user-id and pwd.

Is there any particular reason that you have to use JSP to redirect user from this URL? Should step 3 point directly to the URL of new app?

“Everything should be as simple as it is, but not simpler.” Albert Einstein

abhilash nalla

Greenhorn

Posts: 5

posted 7 years ago

Previously, when they used to hit old URL, it shows login.jsp file. So, I modified this login.jsp file to show them the message and the new URL link. As I mentioned, I tried using i) simple href HTML tag ii) JSP redirect tag. But both are causing issues. When they click this hyperlink, they will be redirected to the new login.jsp file hosted on different server.

Step 3 pointing to new URL was user requirement. We could have just showed the message and asked them to copy and paste URL in browser. But we wanted to give some flexibility to user where they could get to the new server just by clicking on hyperlink. Since hyperlink was causing the issue that I mentioned, we tried using JSP redirect where it would directly take them to new server but even this caused issues.