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

Redirect URL Prefix

M. Siddiqui

Joined: Dec 12, 2006
Posts: 3
I have a JSP with whole bunch of links (HREFs). Now instead of changing all the links is it possible for me to redirect all the links with a prefix.

In other words,
Suppose example.jsp has a is link to AnotherPage.asp
But AnotherPage.asp is moved to a different folder. So obviously the URL changed. Now is it possible for to me to somehow forward all URLs with a specific prefix in my JSP.

I would really appreciate some help.

[ December 12, 2006: Message edited by: Imad Siddiqui ]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If, in web.xml, you create servlet entries for each of your JSPs, (using jsp-file elements) you will be able to create servlet-mapping entries with any url-pattern you like.

If you're not familiar with servlet-entries, there is a link to the servlet spec in my signature. Look at SRV 13.4.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

Front controllers are brialliant for such puposes as they (usually) abstract the references. See this article for an explanation.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Redirect URL Prefix
It's not a secret anymore!