cancel
Showing results for 
Search instead for 
Did you mean: 

creating rest support in my web application.

shiva_arunachal
Champ in-the-making
Champ in-the-making
I have made rest calls by deploying activiti-rest war in tomcat and invoking the url from my web application by

url = new URI("http://localhost:8081/activiti-rest/service/identity/users");


Now i dont want to deploy the activiti-rest as a different webapplication but want to just add rest jar and hit the rest servlet. Now what changes i want to make?

My guess would be to add below in web.xml

<blockcode>
<!– Restlet adapter –> 
  <servlet> 
    <servlet-name>RestletServlet</servlet-name> 
    <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
    <init-param>
      <!– Application class name –>
      <param-name>org.restlet.application</param-name>
      <param-value>org.activiti.rest.common.application.ActivitiRestApplication</param-value>
    </init-param>
  </servlet>
 
  <!– Catch all requests –> 
  <servlet-mapping> 
    <servlet-name>RestletServlet</servlet-name> 
    <url-pattern>/service/*</url-pattern> 
  </servlet-mapping>
</blockcode>

and then hit the url like…
url = new URI("http://localhost:8081/myWebApp/service/identity/users");


Am i right in saying so? or have i missed anything else.?
Thanks in advance.
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
Check the source code of activiti-webapp-rest2 to see how it is configured there.

Note that we migrated to Spring MVC a while ago. You will need to go back in the history to see the sources for the Restlet approach.