When a portlet serveResource() call throws an exception, the portal ignores the exception and the portal page acts as if nothing happened.
A possible workaround is for the portlet to catch the exception and call the following to set the HTTP response code for the Browser:
this.resp.setProperty(ResourceResponse.HTTP_STATUS_CODE, Integer.toString(status));
When a portlet serveResource() call throws an exception, the portal ignores the exception and the portal page acts as if nothing happened.
A possible workaround is for the portlet to catch the exception and call the following to set the HTTP response code for the Browser: