Same initial context for multiple wars in tomcat

219 Views Asked by At

I have 3 separate wars in tomcat and each war contains some restful services, now there are different clients in wars that are calling those services for example servlet maping in war1 is

 <servlet-mapping>
    <servlet-name>Servlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>

access URL will localhost:8080/projectName/services/someservice

similarly in war2

<servlet-mapping>
<servlet-name>Servlet2</servlet-name>
<url-pattern>/postprocessorservices/*</url-pattern>
</servlet-mapping>

access URL will be localhost:8080/differentProjectName/postprocessorservices/someotherservice

I simply want to know that is there a way to provide a common initial context so that same initial context is used in different client for example

localhost:8080/commoncontext/services/someservice
localhost:8080/commoncontext/postprocessorservices/someotherservice

Any help will be greatly appreciated.

0

There are 0 best solutions below