@Override public void handle(Request request, Response response) { String type = request.getMethod().getName(); String uid= (String) request.getAttributes().get("uid"); if(type.equalsIgnoreCase("get")) { (do you processing here) } }
public class CaseQueryExtractor extends Extractor { protected int beforeHandle(Request request, Response response) { extractFromQuery("offset", "offset", true); extractFromQuery("limit", "limit", true); // Stuff happens... CaseQuery query = new CaseQuery(); Map<String,Object> attributes = request.getAttributes(); attributes.put("query", query); return CONTINUE; } }
Form requestHeaders = (Form) request.getAttributes().get("org.restlet.http.headers");
public class Main extends Application { public static void main(String[] args) { Main main = new Main(); main.start(); } private void start() { Component c = new Component(); c.getServers().add(Protocol.HTTP, 80); Application app = new Main(); c.getDefaultHost().attach(app); c.start(); } public Restlet createInboundRoot() { Router router = new Router(getContext()); router.attach("/method/{input}", new Restlet(getContext()) { public void handle(Request request, Response response) { String a = request.getAttributes().get("input").toString(); String b = MyLibraries.compute(a); response.setEntity(b, MediaType.TEXT_HTML); } }); return router; } }
final Attributes old_attr=baseRequest.getAttributes(); MultiMap old_params=baseRequest.getParameters(); try
final Attributes old_attr=baseRequest.getAttributes(); MultiMap old_params=baseRequest.getParameters(); try
final Attributes old_attr=baseRequest.getAttributes(); MultiMap old_params=baseRequest.getParameters(); try
final Attributes old_attr=baseRequest.getAttributes(); MultiMap old_params=baseRequest.getParameters(); try
final Attributes old_attr=baseRequest.getAttributes(); MultiMap old_params=baseRequest.getParameters(); try
final Attributes old_attr=baseRequest.getAttributes(); final MultiMap<String> old_query_params=baseRequest.getQueryParameters(); try
final Attributes old_attr=baseRequest.getAttributes(); final MultiMap<String> old_query_params=baseRequest.getQueryParameters(); try
final Attributes old_attr=baseRequest.getAttributes(); final MultiMap<String> old_query_params=baseRequest.getQueryParameters(); try
final Attributes old_attr=baseRequest.getAttributes(); MultiMap<String> old_params=baseRequest.getParameters(); try
final Attributes old_attr=baseRequest.getAttributes(); MultiMap<String> old_params=baseRequest.getParameters(); try
final String old_query=baseRequest.getQueryString(); final MultiMap<String> old_query_params=baseRequest.getQueryParameters(); final Attributes old_attr=baseRequest.getAttributes(); final DispatcherType old_type=baseRequest.getDispatcherType();
final String old_path_info=baseRequest.getPathInfo(); final String old_query=baseRequest.getQueryString(); final Attributes old_attr=baseRequest.getAttributes(); final DispatcherType old_type=baseRequest.getDispatcherType(); MultiMap<String> old_params=baseRequest.getParameters();
final String old_path_info=baseRequest.getPathInfo(); final String old_query=baseRequest.getQueryString(); final Attributes old_attr=baseRequest.getAttributes(); final DispatcherType old_type=baseRequest.getDispatcherType(); MultiMap<String> old_params=baseRequest.getParameters();
final String old_path_info=baseRequest.getPathInfo(); final String old_query=baseRequest.getQueryString(); final Attributes old_attr=baseRequest.getAttributes(); final DispatcherType old_type=baseRequest.getDispatcherType(); MultiMap<String> old_params=baseRequest.getParameters();
final String old_path_info=baseRequest.getPathInfo(); final String old_query=baseRequest.getQueryString(); final Attributes old_attr=baseRequest.getAttributes(); final DispatcherType old_type=baseRequest.getDispatcherType(); MultiMap<String> old_params=baseRequest.getParameters();
final Attributes old_attr=baseRequest.getAttributes(); final DispatcherType old_type=baseRequest.getDispatcherType();