aspose file tools*
The moose likes Tomcat and the fly likes Redirect servlet URLs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Redirect servlet URLs" Watch "Redirect servlet URLs" New topic
Author

Redirect servlet URLs

Peter Braun
Ranch Hand

Joined: Feb 09, 2005
Posts: 57
Hello,

I would like to ask for some advice. I have some servlets at different URLs which are deprecated now. I would like to redirect all of them to common URL.
Can somebody please tell me how can I do that? Is it possible?

Thanks in advance.

Peter
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Can't you re-map them in the web.xml file?


Ping & DNS - updated with new look and Ping home screen widget
Peter Braun
Ranch Hand

Joined: Feb 09, 2005
Posts: 57
The problem is that there are four servlets are in different directory for legacy reasons. My new servlet is in another one under webapps directory.
For example: I would like to map localhost:8080/oldwebtool/someservlet to localhost:8080/ultimatetool/niceservlet

Do you know if it is possible to map them?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
If oldwebtool and newwebtool are both handled by the same web app (one that can listen on "/"), you can use its web-xml for remapping. But if they're in different web apps, remapping won't work.
In that case, you'd have to do it with Apache, e.g. the mod_rewrite module can do this.
[ November 25, 2005: Message edited by: Ulf Dittmer ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirect servlet URLs
 
Similar Threads
apache url rewriting problem
How to open a jsp page from Action without defining it in Config file?(url dynamical)
SCJP 1.4 mock exam links
404 Error when trying to use a filter for a servlet
controlling the actions to be called