You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Stuart Churchill <sc...@calsoftware.co.uk> on 2011/07/04 15:41:21 UTC
Using Restlet inside a servlet container
Under Camel 2.7.2, I'm trying to establish a configuration to allow me to define Restlet consumers in my camel-context.xml, which are served by a servlet defined in web.xml, with the aim being to;
a) permit the use of relative URI paths in camel-context, giving greater deployment flexibility
b) not start a separate server process on another port and have the servlet container that's already running and hosting everything just handle the incoming request
I've already got a configuration that works with absolute URIs and spawning it's own server process, I'm just trying to identify if what I'd like to do is currently possible and if so, how I need to configure it.
My (ideal world) camel-context.xml looks like this;
<route id="RS_BOB">
<from uri="restlet:/bob/{id}"/>
<transform>
<simple>Request type : ${header.CamelHttpMethod} and ID : ${header.id}</simple>
</transform>
</route>
And at the moment my web.xml looks like this;
<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>/rs/*</url-pattern>
</servlet-mapping>
My aim is to then be able to access the resource at http://localhost:8080/webappname/rs/bob/1234. With the above configuration, I get a 404 back from the servlet container and absolutely nothing in the log files.
Am I at all close, or still a million miles away?
Cheers,
Stu
**********************************************************************
CONFIDENTIALITY:
Cultura Technologies Ltd is a company registered in England and Wales at Rivington House, Drumhead Rd, Chorley, Lancs, PR6 7BX with the company number (1250877). The company VAT number is 732526544. This e-mail and any attachments are intended for the named recipient(s) only and may be confidential or legally privileged.
If you are not a named recipient, you should not access,
disclose, copy, forward or distribute this e-mail. Please delete
if obtained in error and e-mail confirmation to:
postmaster@calsoftware.co.uk
SECURITY:
Please note that this e-mail has been created in the
knowledge that Internet e-mail is not a 100% secure
communications medium. We advise that you understand
and observe this lack of security when e-mailing us.
VIRUSES:
Although Cultura Technologies Ltd has taken steps to ensure
that this e-mail and any attachments are free from any virus,
it advises that in keeping with good computing practice the
recipient should ensure they are actually virus free.
**********************************************************************
Re: Using Restlet inside a servlet container
Posted by Willem Jiang <wi...@gmail.com>.
Hi Stu,
Thanks for the patch.
I just applied it into the trunk.
On 7/5/11 8:53 PM, Stu.C wrote:
> Thanks Maximilien - that's an excellent help and worked exactly as I'd hoped.
>
> I've created a JIRA with a patch
> https://issues.apache.org/jira/browse/CAMEL-4175
> https://issues.apache.org/jira/browse/CAMEL-4175 .
>
> Not being able to use the RestletServlet outside of Camel is not a problem
> for me either, so no worries there.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-Restlet-inside-a-servlet-container-tp4550049p4553158.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang
Re: Using Restlet inside a servlet container
Posted by "Stu.C" <sc...@calsoftware.co.uk>.
Thanks Maximilien - that's an excellent help and worked exactly as I'd hoped.
I've created a JIRA with a patch
https://issues.apache.org/jira/browse/CAMEL-4175
https://issues.apache.org/jira/browse/CAMEL-4175 .
Not being able to use the RestletServlet outside of Camel is not a problem
for me either, so no worries there.
--
View this message in context: http://camel.465427.n5.nabble.com/Using-Restlet-inside-a-servlet-container-tp4550049p4553158.html
Sent from the Camel - Users mailing list archive at Nabble.com.