• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat url pattern

 
Faisal Ahmad
Ranch Hand
Posts: 355
Chrome Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Please see the following pattern:

So, these can be accessed:
Servlet One - http://localhost/webapp/a/b/c
Servlet Two - http://localhost/webapp/a/b/c/d/e

My question:
In future, I may change the url-pattern of servlet One to something like /x. I would like to reflect this change automatically for servlet Two, this way: /x/d/e
I don't want to manually edit the url-pattern for all such servlets. Is it possible? If yes, how? Please guide me. Thanks in advance!
 
Chinmaya Chowdary
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Faisal.

I think it is possible by using Filter, Matcher, Pattern api's. In doFilter method provide like
I have not tested think, I think this serves the purpose. Please correct me, if I made mistakes.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!