Brian Fox
unread,May 6, 2013, 6:56:17 PM5/6/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-s...@googlegroups.com
Hi -
Is there a good spot to detect and handle unbound REST calls?
I'm looking specifically at this code inside WidgetRoutingDispatcher.java. The bind and fireEvent methods will eventually resolve to null for any problematic REST call. I'd like to be able to intercept the error and handle it gracefully with a consistent 400 reply without changing sitebrick code.
private void bindAndReply(HttpServletRequest request, HttpServletResponse response,
PageBook.Page page, Object instance) throws IOException {
// bind request (sets request params, etc).
binder.bind(request, instance);
// call the appropriate handler.
headlessRenderer.render(response, fireEvent(request, page, instance));
}
Any suggestions?
Thanks much,
Brian