String path = ui.getPath(false);
if ("wrongpath".equals(path)) {
context.setRequestUri(URI.create("/bookstore/bookheaders/simple"));
} else if ("throwException".equals(path)) {
context.setProperty("filterexception", "prematch");
throw new InternalServerErrorException(
Response.status(500).type("text/plain")
.entity("Prematch filter error").build());
}
MediaType mt = context.getMediaType();