Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirect URL Prefix

 
M. Siddiqui
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64855
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Front controllers are brialliant for such puposes as they (usually) abstract the references. See this article for an explanation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic