Hi;
I am just curious if there a simple global setting to enforce
auto-url-encode/auto-url-decode of all uri template attributes?
currently, this much is needed for each attribute to be auto-processed:
on the client:
#########################
String volume = "accounts";
String expression = "where first_name like 'And%'";
Template template = new Template(Name.SELECT);
Variable var = new Variable();
var.setEncodingOnFormat(true);
template.getVariables().put(Name.Id.SELECT, var);
Map<String, String> values = new HashMap<String, String>();
values.put(Name.Id.VOLUME, volume);
values.put(Name.Id.SELECT, expression);
String uri = "http://localhost:8181" + template.format(values);
#########################
on the server:
#########################
Router router = new Router(getContext());
TemplateRoute route = router.attach(Name.SELECT, //
new VolumeSelectRestlet(getContext(), client,
volumes));
Variable var = new Variable();
var.setDecodingOnParse(true);
route.getTemplate().getVariables().put(Name.Id.SELECT, var);
#########################
additionally, is there simple way on the client resorce to issue something like
resource.getRequestAttributes().put("select", expression);
and have this attribute auto-substituted in the template? do I need outgoing
router for that?
thanks;
Andrei.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2779532