Hi William,
> 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.
OK
> > 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)?
I don't feel like I have enough info about your overall URI structure and
requirements to make a good recommendation. Could you share more details?
> 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.
You can perfectly update the Request instance, actually I even recommend it
for performance reasons!
Best regards,
Jerome