开发者

Retrieve parameter from the restlet

开发者 https://www.devze.com 2023-03-21 08:42 出处:网络
I need to parse the parameter from the following URL: http://mysite.com/customer/token/name/customerName

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

精彩评论

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