aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Redirect URL Prefix" Watch "Redirect URL Prefix" New topic
Author

Redirect URL Prefix

M. Siddiqui
Greenhorn

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.

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

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
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirect URL Prefix