0

I cannot figure out how to use the an empty path from the servlet. The servlet I am working with is at /items/*

    <servlet>
    <servlet-name>my-rest</servlet-name>
    <servlet-class>org.restlet.ext.spring.RestletFrameworkServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>my-rest</servlet-name>
    <url-pattern>/items/*</url-pattern>
</servlet-mapping>

I can successful map to a path like "localhost:/items/items"

    <bean name="/items"
      id="itemsRoute"
      autowire="byName"
      scope="prototype"
      parent="abstractRestletResources"
      class="com.my.service.rest.resource.ItemResource"/>

But how can I map to the root path? like "localhost:/items" ?

I have other servlets and I really need this one to be at "/items"

Solx
  • 4,611
  • 5
  • 26
  • 29
  • did you try to set the name as follow: "/" or "" ? – Thierry Boileau Sep 05 '15 at 14:55
  • I tried them both with these results: "/" works, but the path then has to end in "/" which was undesirable. If I used "" then I would get some sort of security stack overflow - and the cause of the overflow was not obvious. Note that I have currently avoided the issue and simply made the left side of the path longer so I have more to match, i.e. for now I am using "localhost/v1/items" and am making "v1" the servlet, and "/items" the restlet - so not solved, but using a work around. – Solx Sep 08 '15 at 16:57

0 Answers0