开发者

Retrieve parameter from the restlet

I need to parse the parameter from the following URL: http://mysite.com/customer/token/name/customerName

So there are two parame开发者_JAVA百科ters in above case, customer => token and name => customerName. How do I retrieve parameters (name from the key) for the above url?

Thanks.


You could do something like:

 router.attach("/name/{name}", HelloWorldResource.class);

Then access it like:

 String m = (String)this.getRequestAttributes().get("name");

This is called template.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜