• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Redirecting context paths in Tomcat 5.5

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I have a Tomcat 5.5 running on myserver.com:8080 behind an Apache on port 80.

I have two application under webapps with the following context path:

webapps/app1<Context path=""
webapps/app2<Context path="/app2"

So app1 takes care of every request but:

http://myserver.com/app2/(...)

I have now a new requirement that:

http://myserver.com/newurl

should be forwarded to:

http://myserver.com/app2/

or even better:

http://myserver.com/app2/newurl

I have no control of the Apache server and I cannot change its configuration. Moreover:

Sessions (cookies and URL rewriting as well) should not be affected.

Only /newurl should go under /app2, everthing else (for example /morenewurl) should be not affected and go under /app1

Any idea how I can achieve that?

cheers

renato
 
Renato Losio
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I was able to get what I wanted adding a filter in the app1. All the requests for /newurl are now redirected to /app2/newurl using:






I had to add:




in the app1.xml as well. It works but I'm just wandering if there is a better solution.

cheers

renato
 
reply
    Bookmark Topic Watch Topic
  • New Topic