I'm using <a href="http://www.restlet.org/" rel="nofollow noreferrer">Restlet</a> to make a RESTful platform. I haven't used it before, but I decided to use 2.0 because it is better to start with the latest and greatest technology, right?
The key thing I am looking for is the ability to have someone to put in a URL like
and have the service respond with something like
, so I need to pass in request attributes. Using this post for <a href="http://danilogurovich.wordpress.com/2008/09/23/a-simple-restlet-demo-application/" rel="nofollow noreferrer">Restlet 1.1</a> (because I can't seem to find <em>any</em> documentation for this on the Restlet site), I wired up my application like so:
The new way to do this is apparently in the
method, so mine looks like (without error checking):
The problem is that the
returned from
is always completely empty! This seems rather odd. Am I wiring the routing up wrong?
Of course, I could just use
and parse it myself, but that is definitely the wrong way to go about doing this and it seems like there should be an easy way to do this (similar to the way previous versions worked).
The key thing I am looking for is the ability to have someone to put in a URL like
Code:
http://mysite/New%20York/3
Code:
[New York,New York,New York]
Code:
router.attach("{text}/{count}", RepeaterResource.class);
The new way to do this is apparently in the
Code:
UniformResource#doInit()
Code:
@Override
public void doInit()
{
magicText = "" + getRequestAttributes().get("text");
repeatAmount = Integer.parseInt("" + getRequestAttributes().get("count"));
}
The problem is that the
Code:
Map<String, Object>
Code:
getRequestAttributes()
Of course, I could just use
Code:
getQuery()