Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
19. Mar 2008, 11:31 CET | Link

Hi,

for several time I'm having problems with JS code I generate in a bean and let it execute on client side. First I thought the JavascriptContext provided by ICEfaces was broken, but it isn't. It simply puts the JS call to the request map of the facesContext.getExternalContext(). But the JS call never reached the client.

So I had a look to the server logs and got following excerpt. The bean code that adds the JS call looks like this:

JavascriptContext.addJavascriptCall(facesContext, "window.open('downloadFile?action=view&fileName=" + selectedFile.getName() + "&directory=" + path + "&contentType=" + determineContentType(selectedFile.getName()) + "', 'downloadFile');");
for(Entry<String, Object> entry : facesContext.getExternalContext().getRequestMap().entrySet()) {
	System.out.println(entry.getKey() + ": " + entry.getValue());
}

So it adds the call and prints the request map, just to validate that JavascriptContext does the right thing. So the first line in the excerpt shows that the JS call is included.

The last line shows that Seam destroys this request map entry. And I think, after hours of blaming ICEfaces, this is the cause of my problem. Why destroys Seam this JS call? Please tell me, if you need sources or other information.

2008-03-19 10:14:07,118 INFO [STDOUT] icesoft_javascript_request_key_7698193: window.open('downloadFile?action=view&fileName=2008-01-29_144401.jpg&directory=/T:/aresTemp/12710250/&contentType=', 'downloadFile'); 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preSetVariable.testaction 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postSetVariable.testaction 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.faces.Navigator] redirecting to: /showTestactionForDeveloper.xhtml 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.faces.FacesManager] redirecting to: /ares/showTestactionForDeveloper.seam?cid=11 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preSetVariable.org.jboss.seam.core.Manager 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postSetVariable.org.jboss.seam.core.Manager 2008-03-19 10:14:07,118 DEBUG [com.icesoft.util.SeamUtilities] Enabled redirect from: /ares/showTestactionForDeveloper.seam?cid=11, to: /ares/showTestactionForDeveloper.seam?cid=11 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preRemoveVariable.org.jboss.seam.core.Manager 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,118 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postRemoveVariable.org.jboss.seam.core.Manager 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.afterPhase 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] committing transaction after phase: INVOKE_APPLICATION 5 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.transaction.UTTransaction] committing JTA transaction 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.transaction.EjbSynchronizations] afterBegin 2008-03-19 10:14:07,134 DEBUG [org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor] ++++ LongLivedSessionPropagationInterceptor 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.transaction.EjbSynchronizations] beforeCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.beforeTransactionCompletion 2008-03-19 10:14:07,134 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades 2008-03-19 10:14:07,134 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections 2008-03-19 10:14:07,134 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects 2008-03-19 10:14:07,134 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections 2008-03-19 10:14:07,134 DEBUG [org.hibernate.pretty.Printer] listing entities: 2008-03-19 10:14:07,134 DEBUG [org.hibernate.pretty.Printer] com.idsscheer.ares.entities.Testcase{expResult=After the import is done you have all prerequisites data (user, usergroups, risk, etc) to create testcases and sign-off tasks., refScript=null, critID=0, refLink=null, token=A) Sign-Off-Prerequisites, changeUsrID=STSE, creatorUsrID=STSE, compID=4559, QATID=1, changeDate=2006-09-19 13:39:53, testtime=null, descr=The order of the testcases is very important for testing the Sign-Off Process properly. To make it quite simple, you should import the "Report.xml" file in AAM. (The file is under //Webapps/AAM/Trunk/ArisReport/Testimport in P4). , TTypID=1, createDate=2005-11-18 16:15:16, TCaseVID=29, TObjID=4559, refData=null, ID=34747} 2008-03-19 10:14:07,134 DEBUG [org.hibernate.pretty.Printer] com.idsscheer.ares.entities.User{phone=3796, password=1d0258c2440a8d19e716292b231e3190, tester=-1, PWToken=ba7b8f8e5865bd6a7c6ecc30afd958fd, developer=-1, isQPV=0, TOTRoot=null, email=jens.weintraut@ids-scheer.de, isAdmin=-1, name=Jens Weintraut, ID=JEWE} 2008-03-19 10:14:07,134 DEBUG [org.hibernate.pretty.Printer] com.idsscheer.ares.entities.Revisionclass{descr=Mängel sind zu beseitigen, ID=9} 2008-03-19 10:14:07,134 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.transaction.EjbSynchronizations] beforeCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.beforeTransactionCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.transaction.EjbSynchronizations] beforeCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.beforeTransactionCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.transaction.EjbSynchronizations] afterCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.afterTransactionCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.transaction.EjbSynchronizations] afterCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.afterTransactionCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.transaction.EjbSynchronizations] afterCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.afterTransactionCompletion 2008-03-19 10:14:07,134 DEBUG [org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor] ++++ LongLivedSessionPropagationInterceptor 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Manager] Storing conversation state: 11 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.FacesLifecycle] After render response, destroying contexts 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] destroying business process context 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroyContext.BUSINESS_PROCESS 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postDestroyContext.BUSINESS_PROCESS 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] flushing server-side conversation context 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] flushing session context 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preSetVariable.selectedRelease 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postSetVariable.selectedRelease 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preSetVariable.user 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postSetVariable.user 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preSetVariable.org.jboss.seam.core.conversationEntries 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postSetVariable.org.jboss.seam.core.conversationEntries 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preSetVariable.selectedUser 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postSetVariable.selectedUser 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preSetVariable.testaction 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postSetVariable.testaction 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] destroying event context 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroyContext.EVENT 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.org.jboss.seam.core.manager 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.transaction.synchronizations 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.org.jboss.seam.transaction.synchronizations 2008-03-19 10:14:07,134 DEBUG [org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor] ++++ LongLivedSessionPropagationInterceptor 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.conversationPropagation 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.org.jboss.seam.core.conversationPropagation 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] destroying: ares_messages 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.faces.validation 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.org.jboss.seam.faces.validation 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.transaction.transaction 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.org.jboss.seam.transaction.transaction 2008-03-19 10:14:07,134 DEBUG [org.jboss.seam.contexts.Contexts] destroying: icesoft_javascript_request_key_7698193

Thanks in advance

Jens

6 Replies:
19. Mar 2008, 12:37 CET | Link

After I had a look to the sources of FacesLifecycle and Contexts, I assume that the JS call is saved in the event context, what explains that it is destroyed.

But the component which creates this JS call is in session context. Erm ... OK. It's more complicated, so here's the component:

@Stateful
@Scope(ScopeType.SESSION)
public class UpDownloadFilesystem implements UpDownload {
	@In
	private transient FacesContext facesContext;
	
	private String tempDir;
	private String filesDir;
	
	private boolean showUpDownloadDialog;
	
	public boolean viewFile(UpDownloadFileinfo selectedFile) {
		//do somthing and send JS
		JavascriptContext.addJavascriptCall(facesContext, "JS call here");
	}
	
	//some other methods
}

As you can see, there is no @Name annotation, since this component should be configurable, so this is components.xml:

<component auto-create="true" class="com.idsscheer.ares.sessions.UpDownloadFilesystem" name="upDownload">
	<!-- <property name="tempDir">/home/user/tmp</property>
	<property name="filesDir">/home/user/filestore</property> -->
	<property name="tempDir">T:\\temp</property>
	<property name="filesDir">T:\\dump</property>
</component>

I even added the scope attribute to the component declaration (<component auto-create="true" class="com.idsscheer.ares.sessions.UpDownloadFilesystem" name="upDownload" scope="session">).

But it's still the same. The JS call is destroyed while destroying event context.

19. Mar 2008, 13:29 CET | Link

Now I'm really weird. For faster testing I included a JavascriptContext.addJavascriptCall(FacesContext, String) call (and some debug printing) at the top of the apps' login method:

@Stateless
@Name("login")
public class LoginAction implements Login {
	@Out(scope=ScopeType.SESSION)
	private User user;

	@PersistenceContext
	private transient EntityManager em;

	@In
	private FacesContext facesContext;
	
	public boolean authenticate() {
		JavascriptContext.addJavascriptCall(facesContext, "alert('login');");
		
		for(Entry<String, Object> entry : facesContext.getExternalContext().getRequestMap().entrySet()) {
			System.out.println(entry.getKey() + ": " + entry.getValue());
		}
		for(String name : Contexts.getEventContext().getNames()) {
			System.out.println("event context: " + name + " | " + Contexts.getEventContext().get(name));
		}
		for(String name : Contexts.getSessionContext().getNames()) {
			System.out.println("session context: " + name + " | " + Contexts.getSessionContext().get(name));
		}
		
		//rest omitted
	}
	
	//other stuff
}

If I login successfully, I don't get a alert window. But if I try to login in a way that login() returns false, the alert window is shown twice. For this I included this debug printing of event and session context.

Here is what the console says (successful login):

13:18:40,371 INFO  [STDOUT] org.jboss.seam.core.manager: Manager([2])
13:18:40,371 INFO  [STDOUT] org.jboss.seam.transaction.synchronizations: EjbSynchronizations:4sub52-d6jsty-fdzuu6j8-1-fdzv28gj-2m
13:18:40,371 INFO  [STDOUT] org.jboss.seam.core.conversationPropagation: org.jboss.seam.core.ConversationPropagation@1da6054
13:18:40,371 INFO  [STDOUT] ares_messages: com.sun.facelets.tag.jsf.core.LoadBundleHandler$ResourceBundleMap@1ea4043
13:18:40,371 INFO  [STDOUT] org.jboss.seam.faces.validation: org.jboss.seam.faces.Validation@210f7d
13:18:40,371 INFO  [STDOUT] org.jboss.seam.transaction.transaction: org.jboss.seam.transaction.Transaction@7fee2d
13:18:40,386 INFO  [STDOUT] icesoft_javascript_request_key_7698193: alert('login');
13:18:40,386 INFO  [STDOUT] event context: org.jboss.seam.core.manager | Manager([2])
13:18:40,386 INFO  [STDOUT] event context: org.jboss.seam.transaction.synchronizations | EjbSynchronizations:4sub52-d6jsty-fdzuu6j8-1-fdzv28gj-2m
13:18:40,386 INFO  [STDOUT] event context: org.jboss.seam.core.conversationPropagation | org.jboss.seam.core.ConversationPropagation@1da6054
13:18:40,386 INFO  [STDOUT] event context: ares_messages | com.sun.facelets.tag.jsf.core.LoadBundleHandler$ResourceBundleMap@1ea4043
13:18:40,386 INFO  [STDOUT] event context: org.jboss.seam.faces.validation | org.jboss.seam.faces.Validation@210f7d
13:18:40,386 INFO  [STDOUT] event context: org.jboss.seam.transaction.transaction | org.jboss.seam.transaction.Transaction@7fee2d
13:18:40,386 INFO  [STDOUT] event context: icesoft_javascript_request_key_7698193 | alert('login');
13:18:40,386 INFO  [STDOUT] session context: com.sun.faces.logicalViewMap | {j_id1={j_id2=[Ljava.lang.Object;@ede434}}
13:18:40,386 INFO  [STDOUT] session context: org.jboss.seam.security.identity | org.jboss.seam.security.Identity@213b6e
13:18:40,386 INFO  [STDOUT] session context: org.jboss.seam.core.conversationEntries | ConversationEntries([])
13:18:40,386 INFO  [STDOUT] session context: class com.icesoft.faces.context.ElementController | com.icesoft.faces.context.ElementController@1c4cc78
13:18:40,386 INFO  [STDOUT] session context: icesoft_javascript_required_libs_897241 | [/xmlhttp/1205929109558/ice-extras.js]
13:18:40,386 INFO  [STDOUT] session context: org.jboss.seam.web.session | org.jboss.seam.web.Session@14beca0

And that's the console when I use an unknown user name:

13:19:32,373 INFO  [STDOUT] org.jboss.seam.core.manager: Manager([9])
13:19:32,373 INFO  [STDOUT] org.jboss.seam.transaction.synchronizations: EjbSynchronizations:4sub52-d6jsty-fdzuu6j8-1-fdzv3clh-2v
13:19:32,373 INFO  [STDOUT] org.jboss.seam.core.conversationPropagation: org.jboss.seam.core.ConversationPropagation@15128b4
13:19:32,373 INFO  [STDOUT] ares_messages: com.sun.facelets.tag.jsf.core.LoadBundleHandler$ResourceBundleMap@1477a84
13:19:32,373 INFO  [STDOUT] org.jboss.seam.faces.validation: org.jboss.seam.faces.Validation@1bc8d7d
13:19:32,373 INFO  [STDOUT] org.jboss.seam.transaction.transaction: org.jboss.seam.transaction.Transaction@1ed0b75
13:19:32,373 INFO  [STDOUT] icesoft_javascript_request_key_7698193: alert('login');
13:19:32,373 INFO  [STDOUT] event context: org.jboss.seam.core.manager | Manager([9])
13:19:32,373 INFO  [STDOUT] event context: org.jboss.seam.transaction.synchronizations | EjbSynchronizations:4sub52-d6jsty-fdzuu6j8-1-fdzv3clh-2v
13:19:32,373 INFO  [STDOUT] event context: org.jboss.seam.core.conversationPropagation | org.jboss.seam.core.ConversationPropagation@15128b4
13:19:32,373 INFO  [STDOUT] event context: ares_messages | com.sun.facelets.tag.jsf.core.LoadBundleHandler$ResourceBundleMap@1477a84
13:19:32,373 INFO  [STDOUT] event context: org.jboss.seam.faces.validation | org.jboss.seam.faces.Validation@1bc8d7d
13:19:32,373 INFO  [STDOUT] event context: org.jboss.seam.transaction.transaction | org.jboss.seam.transaction.Transaction@1ed0b75
13:19:32,373 INFO  [STDOUT] event context: icesoft_javascript_request_key_7698193 | alert('login');
13:19:32,373 INFO  [STDOUT] session context: com.sun.faces.logicalViewMap | {j_id5={j_id6=[Ljava.lang.Object;@18b5751}, j_id7={j_id8=[Ljava.lang.Object;@111b1b0}, j_id9={j_id10=[Ljava.lang.Object;@a8cb99}}
13:19:32,373 INFO  [STDOUT] session context: org.jboss.seam.security.identity | org.jboss.seam.security.Identity@1ced32d
13:19:32,373 INFO  [STDOUT] session context: org.jboss.seam.core.conversationEntries | ConversationEntries([])
13:19:32,373 INFO  [STDOUT] session context: class com.icesoft.faces.context.ElementController | com.icesoft.faces.context.ElementController@18a6dd4
13:19:32,373 INFO  [STDOUT] session context: icesoft_javascript_required_libs_897241 | [/xmlhttp/1205929109558/ice-extras.js]
13:19:32,373 INFO  [STDOUT] session context: org.jboss.seam.web.session | org.jboss.seam.web.Session@130b7a2
13:19:32,373 INFO  [STDOUT] Hibernate: select user0_.USR_ID as USR1_143_, user0_.USR_NAME as USR2_143_, user0_.USR_PASSWORD as USR3_143_, user0_.USR_ISADMIN as USR4_143_, user0_.USR_EMAIL as USR5_143_, user0_.USR_ISDEVELOPER as USR6_143_, user0_.USR_ISTESTER as USR7_143_, user0_.USR_PHONE as USR8_143_, user0_.USR_ISQPV as USR9_143_, user0_.USR_PWTOKEN as USR10_143_, user0_.USR_TOTROOT as USR11_143_ from ARISWEBFDB_DEV.USERS user0_ where lower(user0_.USR_ID) like lower(?)
13:19:32,388 INFO  [STDOUT] org.jboss.seam.core.manager: Manager([9])
13:19:32,388 INFO  [STDOUT] org.jboss.seam.transaction.synchronizations: EjbSynchronizations:4sub52-d6jsty-fdzuu6j8-1-fdzv3clh-2v
13:19:32,388 INFO  [STDOUT] org.jboss.seam.core.conversationPropagation: org.jboss.seam.core.ConversationPropagation@15128b4
13:19:32,388 INFO  [STDOUT] ares_messages: com.sun.facelets.tag.jsf.core.LoadBundleHandler$ResourceBundleMap@1477a84
13:19:32,388 INFO  [STDOUT] org.jboss.seam.faces.validation: org.jboss.seam.faces.Validation@1bc8d7d
13:19:32,388 INFO  [STDOUT] org.jboss.seam.security.loginTried: true
13:19:32,388 INFO  [STDOUT] org.jboss.seam.transaction.transaction: org.jboss.seam.transaction.Transaction@1ed0b75
13:19:32,388 INFO  [STDOUT] icesoft_javascript_request_key_7698193: alert('login');alert('login');
13:19:32,388 INFO  [STDOUT] event context: org.jboss.seam.core.manager | Manager([9])
13:19:32,388 INFO  [STDOUT] event context: org.jboss.seam.transaction.synchronizations | EjbSynchronizations:4sub52-d6jsty-fdzuu6j8-1-fdzv3clh-2v
13:19:32,388 INFO  [STDOUT] event context: org.jboss.seam.core.conversationPropagation | org.jboss.seam.core.ConversationPropagation@15128b4
13:19:32,388 INFO  [STDOUT] event context: ares_messages | com.sun.facelets.tag.jsf.core.LoadBundleHandler$ResourceBundleMap@1477a84
13:19:32,388 INFO  [STDOUT] event context: org.jboss.seam.faces.validation | org.jboss.seam.faces.Validation@1bc8d7d
13:19:32,388 INFO  [STDOUT] event context: org.jboss.seam.security.loginTried | true
13:19:32,388 INFO  [STDOUT] event context: org.jboss.seam.transaction.transaction | org.jboss.seam.transaction.Transaction@1ed0b75
13:19:32,388 INFO  [STDOUT] event context: icesoft_javascript_request_key_7698193 | alert('login');alert('login');
13:19:32,388 INFO  [STDOUT] session context: com.sun.faces.logicalViewMap | {j_id5={j_id6=[Ljava.lang.Object;@18b5751}, j_id7={j_id8=[Ljava.lang.Object;@111b1b0}, j_id9={j_id10=[Ljava.lang.Object;@a8cb99}}
13:19:32,388 INFO  [STDOUT] session context: org.jboss.seam.security.identity | org.jboss.seam.security.Identity@1ced32d
13:19:32,388 INFO  [STDOUT] session context: user | com.idsscheer.ares.entities.User@22b3be
13:19:32,388 INFO  [STDOUT] session context: org.jboss.seam.core.conversationEntries | ConversationEntries([])
13:19:32,388 INFO  [STDOUT] session context: class com.icesoft.faces.context.ElementController | com.icesoft.faces.context.ElementController@18a6dd4
13:19:32,388 INFO  [STDOUT] session context: icesoft_javascript_required_libs_897241 | [/xmlhttp/1205929109558/ice-extras.js]
13:19:32,388 INFO  [STDOUT] session context: org.jboss.seam.web.session | org.jboss.seam.web.Session@130b7a2

I'm very confused and don't know what I'm doing wrong. Does anybody have any idea?

Thanks in advance Jens

19. Mar 2008, 14:19 CET | Link

OK. I could fix it myself.

While updating to Seam 2, and ICEfaces 1.7 I changed my navigation from the original in faces-config.xml to the seamish pages.xml. According to the examples I made heavy use, I think even exclusive use, of <redirect> to navigate. This breaks JavascriptContext.addJavascriptCall(). As soon as I replaced some redirects by render, it worked again.

But that leads me to another question: When should I use <redirect> and when should I use <render>? What does each tag do? Additionally I want note that I'm not using conversation context. I'm completely pleased with session and event context.

28. Mar 2008, 16:17 CET | Link

I am not quite certain what you mean when redirect vs render. Do you mean using redirect in pages.xml, vs using a render flag in the xhtml page? If so, then it depends on what you want to do. Using the render flag on your xhtml page can be more efficient (without the whole page refresh that you get from navigation to the same page)...If I understand what you are referring to?

31. Mar 2008, 08:12 CET | Link

It seems we both don't know what the other one is talking about :D

In pages.xml you can navigate to a new page using whether <redirect> or <render> (example from doc):

<navigation from-action="#{documentEditor.update}">
  <rule if-outcome="success">
    <redirect view-id="/viewDocument.xhtml"/>
  </rule>
</navigation>

But you could also use:

<navigation from-action="#{documentEditor.update}">
  <rule if-outcome="success">
    <render view-id="/viewDocument.xhtml"/>
  </rule>
</navigation>

That's what I mean when I'm asking for differences between <render> and <redirect>.

But I don't know what this render flag in xhtml could be?

26. May 2008, 17:25 CET | Link

Did you see this? render vs redirect

I am more an advocate of the single page (really rich-user interface) for business/enterprise solutions, so personally, I don't think this is something I might be interested in. Not sure about your application though. Using ICEfaces, you don't ever have to worry about full page refresh (except on the first time a page is viewed). Otherwise, it's all about the partial page update (only the difference in the Dom tree), which makes the single page application so much more attainable (and usability-friendly).