[
https://issues.apache.org/jira/browse/DELTASPIKE-1202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15476447#comment-15476447
]
Gerhard Petracek edited comment on DELTASPIKE-1202 at 9/9/16 9:52 AM:
----------------------------------------------------------------------
if we support that we lose the ability to perform logic before the
faces-context gets used.
you can use e.g.:
{code}
public void onBeforeFacesRequest(@Observes
@BeforePhase(JsfPhaseId.RESTORE_VIEW) PhaseEvent event) {
//...
}
{code}
see http://deltaspike.apache.org/documentation/jsf.html#BeforePhase/AfterPhase
(that's the reason for changing the ticket to priority "minor")
was (Author: gpetracek):
if we support that we lose the ability to perform logic before the
faces-context gets used.
you can use e.g.:
{code}
public void onBeforeFacesRequest(@Observes
@BeforePhase(JsfPhaseId.RESTORE_VIEW) PhaseEvent event) {
//...
}
{code}
see http://deltaspike.apache.org/documentation/jsf.html#BeforePhase/AfterPhase
> WindowContext not active during JSF event propagation
> -----------------------------------------------------
>
> Key: DELTASPIKE-1202
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1202
> Project: DeltaSpike
> Issue Type: Bug
> Components: JSF22-Module
> Affects Versions: 1.7.1
> Reporter: Sven Linstaedt
> Assignee: Thomas Andraschko
> Priority: Minor
>
> While trying to implement some lifecycle event listeners for performance
> measurement, I had a hard to to figure out, why some of my listeners do not
> get invoked at all. Specifically
> {code}
> @WindowScoped
> public class PerformanceListener implements Serializable {
> void onFacesContextInitialized(@Observes @Initialized FacesContext
> context) {
> System.out.println("Context active: " + context);
> }
> }
> {code}
> does not get fired, because the WindowContext is not active. Even though to
> some ContextNotActiveException beeing thrown, latest stable Weld catches
> these exceptions and do not invoke the listener at all.
> As window handling is performed via DS using the default config, I thought
> the window is active when FacesContext is created.
> According to DeltaSpikeLifecycleWrapper#execute the WindowContext gets
> activated after @Initialized FacesContext event being thrown. Is there a
> reason for that behavior, because the current implementation will restrict
> all ClientWindow-based scoped beans to receive only @Destroyed FacesContext,
> but not @Initialized FacesContext events. From my humble point of view, the
> WindowContext could/should be activated, when Lifecycle#attachWindow is
> called.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)