【发布时间】:2010-05-05 13:32:58
【问题描述】:
我正在尝试弄清楚如何从 Restlet 请求对象中获取参数。
我的请求以 /customer?userId=1 的形式出现,我想获取参数以传递给我的 DAO 以进行查询。
public class CustomerResource extends ServerResource
{
@Get("xml")
public Representation toXml() throws ResourceException, Exception
{
try
{
//get param from request
//call DAO with parameter
}
catch(Exception e)
{
throw e;
}
}
}
【问题讨论】: