In a Restlet application, if I do this:
@Override
public Restlet createRoot() {
log.info("createRoot() called");
Router router = new Router(getContext());
// Front page "index"
router.attach("", FrontResource.class);
// Rule database group
router.attach("group", GroupResource.class);
return router;
}
The application works fine, but only if I initially access i.e.
http://localhost:8080/
Accessing other URLs, like http://localhost:8080/something.xml doesn't give
me 404, but instead gives the front resource.
group resource is accessible through http://localhost:8080/group and
http://localhost:8080/group.xml
If I change the implementation to this:
@Override
public Restlet createRoot() {
log.info("createRoot() called");
Router router = new Router(getContext());
// Front page "index"
router.attach("/", FrontResource.class);
// Rule database group
router.attach("/group", GroupResource.class);
return router;
}
The application doesn't work, accessing i.e. http://localhost:8080/ gives
me:
The server has not found anything matching the request URI
You can get technical details
here<http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5>
.
Please continue your visit at our home page <http://localhost:8080/>.
neither does any other URLs.
Please help. Thank you.
I'm using restlet 1.1-m4.
--
Best regards,
Hendy Irawan