Reputation: 35276
Here is my Filter code that I need to fix. The idea behind the filter is that if some query string is found. Process it, no need to return or process the chain or something like that. However when no query string is found, the original request should be serviced, e.g. get/put/update/delete request.
@Override
protected int doHandle(Request request, Response response) {
HttpServletRequest servletRequest = ServletUtils.getRequest(request);
HttpServletResponse servletResponse = ServletUtils.getResponse(response);
String query = servletRequest.getQueryString();
LOG.info("Query=" + query);
if(query != null && query.contains(ESCAPED_FRAGMENT_FORMAT1)){
// TODO: return a HTML String, no need to go down the chain.
return STOP;
} else {
// TODO: need to execute the original request
return SKIP;
}
return CONTINUE;
}
The problem here is that I am not totally sure where to return STOP, SKIP and CONTINUE in this code to achive what I need.
Upvotes: 0
Views: 647
Reputation: 866
You can find the needed explanations in the javadocs: http://restlet.com/technical-resources/restlet-framework/javadocs/2.3/jse/api/org/restlet/routing/Filter.html
I hope this will help you.
Upvotes: 1