Hello Venkat,

at this time, and using this kind of configuration, this is not literally
possible. The problem is that the servlet's instance of Application is
"attached" to a particular root uri, and can't be attached to another one.
You can define another servlet pointing to the same Application (even if
that means that actually each servlet will have their own instance of the
same Application).

Another way is to simply define your own Component, instead of defining an
application:

                 <init-param>
                         <param-name>org.restlet.component</param-name>
                         <param-value>test.MyComponent</param-value>
                 </init-param>


By doing so, you can attach your application as you want:
getDefaultHost().attach("external", new MyApplication());
getDefaultHost().attach("internal", new MyApplication());

You can find more documentation about configuration here
http://www.restlet.org/documentation/2.0/jee/ext/org/restlet/ext/servlet/ServerServlet.html
.

Best regards,
Thierry Boileau


Good afternoon.
> We have a requirement that RestletServlet mapped to two url mappings as
> follows:
> <servlet>
>    <servlet-name>RestletServlet</servlet-name>
>    <servlet-class>
>        org.restlet.ext.servlet.ServerServlet
>    </servlet-class>
> </servlet>
>
> <servlet-mapping>
>    <servlet-name>RestletServlet</servlet-name>
>    <url-pattern>/external/*</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
>    <servlet-name>RestletServlet</servlet-name>
>    <url-pattern>/internal/*</url-pattern>
> </servlet-mapping>
>
> I found that one of them works (either internal or external but not both).
> Could you please let me know if there is a workaround regarding this.
>
> Thanks
> Venkat
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2720222
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2720572

Reply via email to