AnsweredAssumed Answered

How do I change the Spring MVC servlet mapping for only the Activiti REST endpoints?

Question asked by mjustin on Feb 5, 2015
Latest reply on Mar 16, 2015 by mjustin
I am working on an application where we are using Spring Boot and Activiti REST version 5.17.0 (using spring-boot-starter-rest-api).  As the application already has REST endpoints of its own, we would like to put the Activiti REST endpoints in a separate path, e.g.

I want my existing REST endpoints to be unchanged, e.g. "www.example.com:1234/myAppNameHere/myResource/1234".  However, I cannot figure out how to configure this.

I was able to achieve this in another application using Activiti 5.14 with its Restlet functionality by configuring the web.xml file:

<servlet>  
  <servlet-name>RestletServlet</servlet-name> 
  <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
  <init-param>
    <param-name>org.restlet.application</param-name>
    <param-value>my.organization.appname.MyAppActivitiRestApplication</param-value>
  </init-param>
</servlet>

<servlet-mapping>
  <servlet-name>RestletServlet</servlet-name>
  <url-pattern>/bpm-rest/*</url-pattern>
</servlet-mapping>

However, I am unsure how I would duplicate this functionality with the Spring Boot/Spring MVC configuration.  I asked a similar question a while back (http://forums.activiti.org/comment/26977), when I was attempting to upgrade my other application to Activiti 5.16.4.  In that thread I was advised that I could change the servlet mapping "by overriding the WebConfigurer class".  However, I do not see a class with that name in either Activiti or Spring MVC.  There is one in Spring Boot under "org.springframework.boot.test", but I suspect that's not the one being referred to.

In short, how do I configure the Activiti 5.17.0 Spring MVC REST endpoints to use a separate sub-path of my application from my application endpoints?

Outcomes