Hi,
Problem Statement : If any of the component in a page throws 500 error(HTTP Status code), whole page gets broken.
Solutions Tried : We created a JSP (Exception.jsp) in the path /apps/sling/servlet/errorhandler/. In Exception.jsp, we have written single line of code which is :
<%
response.setStatus(500);
%>
Actual Outcome : If we try to hit the promblematic component manually(http://<page><component>.html), then status code comes as 500, but in case if we hit the page (http://<page>.html), then page comes totally broken and status code is coming as 200 for the page.I've checked one more thing which is "response.isCommitted()". This comes as "false" when we hit the component, but gives "true" when we hit the page, which signifies that status code can't be altered for the page.
We are looking for a solution in which :
1. Either the problematic component(component which is throwing 500 error) does not show at all on the page and rest of the page works fine.
2. Page may be broken, but status code for whole page should be 500.
Any help would be highly appreciated.
Thanks
Nikhil