0

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.

Ali
  • 557
  • 1
  • 9
  • 30
  • You could create a facade project that will redirect the calls to the proper services, but i think that it will be an waste of time. Given that you already have clients to those services, just define on then the service it will access. – Jorge Campos Feb 03 '16 at 02:34
  • You could also use this solution: https://rvdb.wordpress.com/2012/04/26/reverse-proxying-tomcat-webapps-behind-apache/ that is mentioned on this answer here: http://stackoverflow.com/a/18438820/460557 – Jorge Campos Feb 03 '16 at 02:39

0 Answers0