You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2009/10/21 20:45:59 UTC

[jira] Commented: (SLING-1121) ServletResolver not properly resolving custom error handler 500 servlet/script

    [ https://issues.apache.org/jira/browse/SLING-1121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768363#action_12768363 ] 

Felix Meschberger commented on SLING-1121:
------------------------------------------

I think this is a misunderstanding, probably.

The status code error handling scripts are only triggered by the HttpServletResponse.sendError calls. If an uncaught Throwable is caught, it is handled by the respective handler script or the DefaultErrorHandler as a fallback. The latter will HttpServletResponse.setStatus the 500/INTERNAL SERVER ERROR status but not call the sendError method. Hence the 500.jsp will not be called in this case.

Your using a Throwable script is quite correct and intended.

> ServletResolver not properly resolving custom error handler 500 servlet/script
> ------------------------------------------------------------------------------
>
>                 Key: SLING-1121
>                 URL: https://issues.apache.org/jira/browse/SLING-1121
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>    Affects Versions:  Servlets Resolver 2.0.6
>         Environment: Day CQ5.2.1
>            Reporter: zhangchunlong
>            Priority: Minor
>
> Added script named 500.jsp to apps/sling/servlet/errorhandler and servlet resolver is not locating resource. 
> Have another script at this location (404.jsp) and works fine. In the meantime added a Throwable.jsp script to that location to handle that at exception and is recognized by the ServletResolver.
> To reproduce:
> 1. Create script named 500.jsp in /apps/sling/servlet/errorhandler ( script can be as simple as static html or can include some logic..doesnt really matter )
> 2. Generate 500 error ( in publish or preview mode )
> 3. Notice that this script was ignored...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.