Solved

Create A Centralized Redirect Using JSP

Posted on 2004-04-07
9
248 Views
Last Modified: 2010-04-01
Problem:
We have recently redesigned/reorganized our website (approximately 60,000 pages, http://www.wicourts.gov).  We have a large user base (basically the entire state of Wisconsin), who have bookmarked various pages on the old website.  As a courtesy to our customers, we want to have a centralized redirection system, that way we don't have to create a zillion different redirection pages.  In addition, we want the user to know that the page no longer exists and that they are being redirected to a new page (thus giving them the opportunity to update their bookmarks).

Possible Solution:
One solution that I have come up with is having one JSP page that accepts 2 parameters (the original page and the new page).  Since we are using Apache, we can setup redirects for a particular page that redirects the user to the JSP page (obviously passing the appropriate parameters), waits 5-10 seconds, and then sends them to the appropriate page.  The parameters will be used to display information back to the user and assist in redirecting to the new page (I hope that makes sense).

The Challenge:
Although the solution above might work, I wanted to pose the question to this community to get some various feedback.  I could very well just do a simple redirect using Apache and be done with it, but that does not prompt the user to update their bookmarks.  I could have also created the zillion pages and do the redirect that way as well... but that would be very labor intensive.  Has anyone else had to do something similar?  If so, how did you accomplish the task?

The best response get the max points...
0
Comment
Question by:kirbinator
9 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10780213
the approach you are proposing sounds reasonable. How are u storing the redirect mappings?
0
 

Author Comment

by:kirbinator
ID: 10780482
I was just going to add the redirects in the query string within the httpd.conf file.  Something like this

Redirect "/somedir/index.html" "/redirect.jsp?referring=/somedir/index.html&new=/newdir/index.html"

Do you know (or think) of a better way?

0
 
LVL 92

Accepted Solution

by:
objects earned 125 total points
ID: 10780516
if you stored them in a db for example then all the redirecting jsp would need would be the old url.
u could then perhaps just redirect all missing pages which could lookup whether a redirect existed, and perform it if so.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 7

Assisted Solution

by:searlas
searlas earned 125 total points
ID: 10781466
If this is a reorganization (as you say), you should seriously consider RedirectPermanent and or 'RedirectMatch permanent', this allows some browsers to automatically update their Favorites/bookmarks without user intervention.
0
 
LVL 5

Assisted Solution

by:KarcOrigin
KarcOrigin earned 125 total points
ID: 10781539
Hi,

This is just an idea. Can you afford using XML mappings? Actually you need a controller JSP/Servlet which just read the XML file fetch the action (which is your old URLs in your case) mapped with the redirection page URL. By combining this approch you would never need to complie or change anything on JSP in future also. Just change the XML file which stores the mapping of actions and their corresponding redirection URL.

You can even avoid to restart your server once you change anything in the XML file. I hope this may give you some idea and the beauty of using XML as a redirection center of gravity. It is also better if you map your future "new URLs" with the "new actions" (It is just a suggestion)

Thx
0
 
LVL 19

Assisted Solution

by:Kuldeepchaturvedi
Kuldeepchaturvedi earned 125 total points
ID: 10782927
Have you thought of using a filter servlet???
you will have to update your web.xml to have a filter setting on the web application.....

so automatically every request to your web site will go to this filter..

now this filter can choose any method to find the new page (either database,XML, or anything else that you might come up with to store the redirection mappings)..

All this filter will do is to read this mapping and redirect appropriately....

I know I am giving quite sketchy details here, but we can start and build as we go..

Regards
0
 
LVL 1

Expert Comment

by:KartikShah
ID: 10919316
One option, if you are using is, that you can keep a redirect map either in memory or the DB.

Remove all the old files from the system, and in the web.xml, for a 404 error forward the request to the redirect JSP that will check whether .. the requested url is an old url or not.

If it is an old URL, you can redirect it to the correspoding new page using the redirect map, or else you can display the 404 error. :)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now