String restapihost = getContext().getParameters().getFirstValue("restapi.host","localhost");
String restapiport = getContext().getParameters().getFirstValue("restapi.port","8111");
String target = "http://"+restapihost+":"+restapiport+"/v1{rr}";
router.setDefaultMatchingMode(Template.MODE_STARTS_WITH);
Redirector redirector = new Redirector(getContext(),target, Redirector.MODE_SERVER_OUTBOUND);
router.attach("/v1", redirector);
router.attach("/", new Directory(getContext(), "war:///"));
return router;
};