-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-existent view with non-standard mapping incorrectly throws ViewHandlingStrategyNotFoundException instead of returning 404 #5120
Milestone
Comments
arjantijms
added a commit
that referenced
this issue
Jun 19, 2022
Fix #5120: no need to doublecheck if view exists when invoked via ViewHandler#deriveLogicalViewId() instead of deriveViewId()
With this change, a TCK test now fails. /**
* @testName: viewHandlerDeriveLogicalViewIDTest
*
* @assertion_ids: JSF:JAVADOC:368; JSF:JAVADOC:2533
*
* @test_Strategy: Validate that we Derive and return the viewId from the
* current request. (with no physical view)
*
* @since: 2.2
*/
public void viewHandlerDeriveLogicalViewIDTest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
String viewId = "/viewId";
FacesContext context = getFacesContext();
ViewHandler vh = getApplication().getViewHandler();
// Get viewId
String derivedId = vh.deriveLogicalViewId(context, viewId);
if (!viewId.equals(derivedId)) {
out.println(JSFTestUtil.FAIL + [JSFTestUtil.NL](http://jsftestutil.nl/)
+ "Unexpectecd value from ViewHandler.deriveViewId()" + [JSFTestUtil.NL](http://jsftestutil.nl/)
+ "Execpted: " + viewId + [JSFTestUtil.NL](http://jsftestutil.nl/) + "Received: " + derivedId);
} else {
out.println(JSFTestUtil.PASS);
}
}// End viewHandlerDeriveLogicalViewIDTest Note that the referenced |
CC @BalusC |
arjantijms
added a commit
to arjantijms/mojarra
that referenced
this issue
Mar 14, 2023
Signed-off-by: Arjan Tijms <arjan.tijms@gmail.com>
arjantijms
added a commit
to arjantijms/mojarra
that referenced
this issue
Mar 14, 2023
This fixes the TCK failure introduced by issue eclipse-ee4j#5120 and pr eclipse-ee4j#5121 Signed-off-by: Arjan Tijms <arjan.tijms@omnifish.ee>
arjantijms
added a commit
that referenced
this issue
Mar 14, 2023
Fix for derivePhysicalViewId broken in #5120
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discovered in omnifaces/omnifaces@9d1ebaf
Have an additional mapping on FacesServlet using an URL pattern which does not match Facelets default suffix:
Opening non-existent view on an URL pattern which coincidentally matches Facelets default suffix of .xhtml such as
/foo.xhtml
correctly returns 404.However, opening non-existent view on an URL pattern which does not match Facelets default suffix of .xhtml such as
/foo.jsf
incorrectly throwsViewHandlingStrategyNotFoundException
instead of returning 404.It worked fine in Mojarra 4.0.0-M1.
The bug was introduced during 45848de
The
ViewHandler#deriveLogicalViewId()
is specified to allow returning non-existent view IDs. However during abovementioned work it's converting view ID usingMultiViewHandler#convertViewId()
which by itself does:This check is in hindsight superflous and should be removed. The
convertViewId()
method is nowhere else used. TheViewHandler#deriveViewId()
already does that check by itself.The text was updated successfully, but these errors were encountered: