Dec
10
|
To add a single Protocol you can set the client property of the Component to the required Protocol. For example to wire up a Component and add the file:// protocol you would use the following.
<bean id="component" class="org.restlet.ext.spring.SpringComponent"> <property name="server"> <bean class="org.restlet.ext.spring.SpringServer"> <constructor-arg value="http" /> <constructor-arg value="8080" /> </bean> </property> <property name="client"> <util:constant static-field="org.restlet.data.Protocol.FILE"/> </property> <property name="defaultTarget" ref="router" /> </bean>
Array ( ) 4 Responses to “How to add a protocol to my Restlet application using Spring?”
Leave a Reply
You must be logged in to post a comment.
June 22nd, 2009 at 1:54 pm
I am trying to make a client request through the proxy server for Restlets. I need to specify the host and port to make that request. Any idea on how this could be done?
June 22nd, 2009 at 1:55 pm
Also, I should not be passing these values through a constructor as shown above, but rather need to pass it as probably a property value or similar.
June 23rd, 2009 at 12:21 am
Albert,
Not sure I follow.
What exactly is the request being sent?
And how is the proxy involved?
June 23rd, 2009 at 2:08 am
I am using JMeter to record http proxy requests through junits. For this reason, I need to find a hook( for Restlet applications) to be able to redirect my junits to go through the proxy server ( host will be local host and port will be some port, for eg port 8080). I was able to find this hook for testing cxf services by using the http:conduit element that is available. I am trying to find a similar way to be able to do the same for Restlet services. The above code (for how to add a protocol to my Restlet application using Spring) looks close to what I might need, but not sure how to tweak it to make it work for my case. Or maybe I might need some way to add the host and the port as a property?