Skip to content

Instantly share code, notes, and snippets.

@authsec
Created June 1, 2016 21:23
Show Gist options
  • Save authsec/0c11168e2f7430623fae1f306d5c3f07 to your computer and use it in GitHub Desktop.
Save authsec/0c11168e2f7430623fae1f306d5c3f07 to your computer and use it in GitHub Desktop.
ReST Endpoint Catch All
@ApplicationScoped @Path("/") @Produces(MediaType.TEXT_HTML)
public class Index {
@GET @Path("/{any : .*}")
public Response root() {
return Response.ok().entity("<!DOCTYPE html>\n" +
"<html>\n" +
" <head>\n" +
" <title>Response</title>\n" +
" </head>\n" +
" <body>\n" +
" <h1>Catch All Response</h1>\n" +
" </body>\n" +
"</html>").build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment