In jakarta mojarra 4.0.11 the action attribute of the form component is not using the forwarded request URI but the normal request URI.
This was not the case in javax mojarra 2.3.18 as i see now during migration.
In my more complex case this is a problem when using a reverse-proxy since the proxied URI of the action attribute does not map to a file leading to a FileNotFoundException in the resource handler request.
Example site requestData.xhtml
The URI is rewritten using OCPsoft rewrite tool to a shorter name without extension: reqData.
Content of test file and result (in comments) when accessing the site in browser with: localhost:8080/MyApp/reqData.
<h:panelGrid columns="2">
<!-- /MySite/reqData -->
<h:outputText value="forward.request_uri"/>
<h:outputText value="#{requestScope['jakarta.servlet.forward.request_uri']}" />
<!-- /MySite/requestData.xhtml -->
<h:outputText value="request.requestURI" />
<h:outputText value="#{request.requestURI}" />
</h:panelGrid>
<!-- wrong action="/MySite/requestData.xhtml" -->
<h:form id="testFormMojarra">
<p:commandButton value="refresh" update="@all"/>
</h:form>
<!-- correct action="/MySite/reqData" -->
<o:form id="testFormOmnifaces">
<p:commandButton value="refresh" update="@all"/>
</o:form>
Question
Is this intended or a regression bug?
Workaround
It seems i can use OmniFaces o:form instead which respects the forwarded URI or override the mojarra FormRenderer.