Skip to content

MultiViewHandler#derivePhysicalViewId fails when error dispatcher is invoked on an error page mapped at virtual path #5618

@BalusC

Description

@BalusC
  • Tomcat/Spring/REST/Faces app migrated from Mojarra 2.3.13 to Mojarra 4.0.11
  • have FacesServlet mapped at virtual path, e.g. *.faces
  • have a Faces page as (general) <error-page> at virtual path, e.g. /error.faces
  • have another servlet running in same app, e.g. Jakarta REST at /api/* or even (Spring) WebSocket handler at /
  • have it throw an exception and invoke ERROR dispatcher
  • ERROR dispatcher invokes FacesServlet, because error page is a Faces page
  • Mojarra's MultiViewHandler#derivePhysicalViewId attempts to figure out the mapping used by FacesServlet
  • expects it to be *.faces, but it's actually /api/* or /, so it cannot find /error.xhtml anymore
  • error page rendering completely fails

Appears to be regression introduced by the change of the mapping inspection to utilize the in Servlet 4 introduced HttpServletRequest#getHttpServletMapping as per 45848de

Work around: add *.xhtml mapping to FacesServlet in web.xml and configure error page on /error.xhtml instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions