Regression fixes after resurrecting lost tck#5774
Merged
Merged
Conversation
The CSP rework (jakartaee/faces#1590) added flushPendingBehaviorEventListeners to PassthroughRenderer.encodeEnd but never queued the behaviors in encodeBegin, so f:ajax and other client behaviors on passthrough HTML5 elements (article, aside, nav, section, h1-h6, ...) emitted no event handler at all and never fired. - PassthroughRenderer.encodeBegin: pass the component's client behaviors through so non-default DOM events (e.g. mouseover) are rendered by the behavior-aware renderPassThruAttributes overload, and render the default click/action behavior via renderOnclickEventListener. The overload's optimization nulls the lone default-event behavior, so it must be rendered explicitly, as CommandLinkRenderer does; both are queued as CSP-safe listeners that encodeEnd flushes. - HtmlResponseWriter.getElementName: do not substitute the passthrough localName for framework-generated <script>/<style> elements, otherwise the behavior listener script was emitted as <article> instead of <script>. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In a namespaced view (UIViewRoot is a NamingContainer, e.g. a portlet) the form ViewState field is named <prefix>jakarta.faces.ViewState<sep><counter>. Two namespace-aware lookups were lost in the faces.js modernization, so faces.ajax.request threw "Form has no view state element" and no Ajax fired. - getHiddenStateField (faces/ajax.ts): restore the fallback that scans form.elements for a field whose name contains the state field name. The exact-name lookup cannot find the field before the prefix is known, yet the prefix is derived from that same field's name — only the fallback breaks the chicken-and-egg. Dropped in #5728 (TypeScript migration). - getPartialViewState (faces/api.ts): match the always-included ViewState and ClientWindow params by substring so the namespaced field survives a partial submit instead of being filtered out. Bare-name matching dates to #5141 (optional partial submit). Replace the stale "intentionally not covered by unit tests" note with Jest coverage for faces.ajax.request in a namespaced view — restoring the fallback is what makes that path constructible in jsdom. Caught by the Faces TCK namespaced-params test (Spec790 portlet namespacing). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
67772fa to
f046806
Compare
Resource injection (@resource, @Inject) and @PostConstruct on faces-config-declared artifacts (factories, ActionListener, NavigationHandler, PhaseListener, ...) went through the container-provided InjectionProvider, which is not available in all environments. Delegate instead to CDI's non-contextual InjectionTarget, the same mechanism FactoryFinderInstance already uses to inject factories. Fixes the Faces TCK Spec763 injection test, which asserts injection and @PostConstruct fire on every injectable faces-config artifact type. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pzygielo
pushed a commit
to pzygielo/mojarra
that referenced
this pull request
Jun 7, 2026
pzygielo
pushed a commit
to pzygielo/mojarra
that referenced
this pull request
Jun 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
jakartaee/faces#2181
Will backport to 4.x once merged.