Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there a mechanism to pass data sets to downstream Restlets?

0
Posted

Is there a mechanism to pass data sets to downstream Restlets?

0

Yes, there are multiple mechanisms available. If you need to store state, without any validation logic or behavior, you can use the Request.getAttributes() method which returns a modifiable map object. Otherwise, you can wrap the Request object into a larger one containing the extra properties and methods that you need. For this purpose, you just have to create a subclass of org.restlet.util.WrapperRequest. Then, in one of your handle methods, you can simply wrap the current call instance. Unless you use a common base Restlet you will need to properly cast the call instance in subsequent Restlets in order to access to your wrapper methods.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123