>> It is of the attach("/",yourRestlet) approach, set to exact
>> match. I use
>> the default route for handling things unmapped. That
>> currently returns a 404 page.
>
> Are you using the MODE_EQUALS matching mode instead of the
> MODE_STARTS_WITH
> one on your router?
Yes I am. Otherwise, things that are invalid requests just display the
home page. For now, I want bad requests to 404; in the future, I'll want
more complex behavior. So I have my HomePageRestlet mapped to "/" alone,
and my NotFoundRestlet set as the router's default.
> If so, you should change it or, if you can't, you could
> attach something like this to your router:
>
> Route route = attach("/?{query}", yourRestlet);
> route.getTemplate().getVariables().put("query", new
> Variable(Variable.TYPE_URI_QUERY));
Ah, that makes sense.
Supposing these weird requests might come to any restlet, would you
recommend doing this for all of them, or just changing the Request object
early on (in, say, application.handle or router.handle)?
And assuming the latter, from your perspective is it better to modify the
existing Request object, or to make a new one with slightly different
contents? From my perspective either one seems to work, but I'm wondering
if something else in the framework will be thrown off by modifying the
existing request.
William