You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave <ja...@yahoo.com> on 2007/12/10 18:45:46 UTC

Jboss 4.2.2 RI did not work for clicking links w/ target=_blank

  Everything works fine for myfaces on Jboss 4.0.5GA. After I moved to JBoss 4.2.2 with faces RI. I got issues when clicking a command link with target=_blank. First time clicking the link is ok, but clicking the link again did not work, did not go to the Invoke Application phase to execute action.  
   
  I suspect the RI did not serialize the request scope beans. So they are shared between requests.
   
  What is the RI param for 
  org.apache.myfaces.SERIALIZE_STATE_IN_SESSION ?
   
  Thanks for help!
  Dave

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: Jboss 4.2.2 RI did not work for clicking links w/ target=_blank

Posted by Ryan Lubke <Ry...@Sun.COM>.
I haven't seen the connection yet.

I'm curious what happens with the app using myfaces with the
server serialization disabled.


Simon Kitching-4 wrote:
> 
> 
> On Tue, 2007-12-11 at 08:37 -0800, Ryan Lubke wrote:
>> 
>> 
>> Dave-53 wrote:
>> > 
>> > Hi Ryan,
>> >    
>> >   Thanks for help.  In web.xml,  we have
>> >    
>> >   <context-param>
>> >   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
>> >   <param-value>server</param-value>
>> >   </context-param>
>> >   
>> >   <context-param>
>> >  
>> <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
>> >   <param-value>20</param-value>
>> >   </context-param> 
>> >   
>> >   <context-param>
>> >  
>> <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
>> >   <param-value>true</param-value>
>> >   </context-param> 
>> >   
>> >   <context-param>
>> >   <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
>> >   <param-value>false</param-value>
>> >   </context-param> 
>> >   
>> > These parameters are not changed for RI,  I am wondering if I need to
>> > change or add some for RI.
>> >    
>> >   Yes, I use <t:saveState> to save request-scope bean data. 
>> >   The senarios:
>> >    
>> >   On window 1, click link A, execute action that changed request scope
>> > bean data Foo, the response was shown on Window 2.  It worked well.
>> >    
>> >   Again on window 1, click link A, this step did not go through Invoke
>> > Application phase.
>> >    
>> >   It works for MyFaces.
>> >    
>> >   Thanks for any help.
>> >   Dave
>> >   
>> > 
>> 
>> Well, JBoss 4.2.2 uses JSF RI 1.2_04 P02.  Try upgrading to 1.2_06 [1],
>> and
>> set com.sun.faces.serializeServerState to true.
>> We added the option to serialize component state to the session in
>> 1.2_05. 
>> 
>> [1]
>> https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderID=8346&expandFolder=8346&folderID=0
>> 
> 
> Serializing the state (1) saves server memory, and (2) avoids ugly
> surprises when an app is later clustered and suddenly it is realised
> that objects in the component tree are not serializable.
> 
> Similarly for compressing the state, that just saves memory but should
> have no effect on the app behaviour.
> 
> I cannot see what link there could be between either of these settings
> and the described symptoms.
> 
> Cheers,
> 
> Simon
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Jboss-4.2.2-RI-did-not-work-for-clicking-links-w--target%3D_blank-tp14257806p14278680.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Jboss 4.2.2 RI did not work for clicking links w/ target=_blank

Posted by Dave <ja...@yahoo.com>.
I downloaded ri jsf 1.2_07 and replaced jsp-api.jar and jsf-imp.jar under JBoss 4.2.2 jsf-libs.
com.sun.faces.serializeServerState is set to true in web.xml.     
  But I got the following exception:

   ERROR [[FacesServlet]] Servlet.service() for servlet FacesServlet threw exception
java.lang.ClassNotFoundException: boolean
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at com.sun.faces.renderkit.ApplicationObjectInputStream.resolveClass(ApplicationObjectInputStream.java:74)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
        at java.io.ObjectInputStream.readClass(ObjectInputStream.java:1462)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1312)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at java.util.ArrayList.readObject(ArrayList.java:593)
        at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at java.util.ArrayList.readObject(ArrayList.java:593)
        at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)

   
  Thanks for help
  Dave
  

simon <si...@chello.at> wrote:
  
On Tue, 2007-12-11 at 08:37 -0800, Ryan Lubke wrote:
> 
> 
> Dave-53 wrote:
> > 
> > Hi Ryan,
> > 
> > Thanks for help. In web.xml, we have
> > 
> > 
> > 
javax.faces.STATE_SAVING_METHOD

> > 
server

> > 
> > 
> > 
> > 
org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION

> > 
20

> > 
> > 
> > 
> > 
org.apache.myfaces.SERIALIZE_STATE_IN_SESSION

> > 
true

> > 
> > 
> > 
> > 
org.apache.myfaces.COMPRESS_STATE_IN_SESSION

> > 
false

> > 
> > 
> > These parameters are not changed for RI, I am wondering if I need to
> > change or add some for RI.
> > 
> > Yes, I use to save request-scope bean data. 
> > The senarios:
> > 
> > On window 1, click link A, execute action that changed request scope
> > bean data Foo, the response was shown on Window 2. It worked well.
> > 
> > Again on window 1, click link A, this step did not go through Invoke
> > Application phase.
> > 
> > It works for MyFaces.
> > 
> > Thanks for any help.
> > Dave
> > 
> > 
> 
> Well, JBoss 4.2.2 uses JSF RI 1.2_04 P02. Try upgrading to 1.2_06 [1], and
> set com.sun.faces.serializeServerState to true.
> We added the option to serialize component state to the session in 1.2_05. 
> 
> [1]
> https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderID=8346&expandFolder=8346&folderID=0
> 

Serializing the state (1) saves server memory, and (2) avoids ugly
surprises when an app is later clustered and suddenly it is realised
that objects in the component tree are not serializable.

Similarly for compressing the state, that just saves memory but should
have no effect on the app behaviour.

I cannot see what link there could be between either of these settings
and the described symptoms.

Cheers,

Simon



       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

Re: Jboss 4.2.2 RI did not work for clicking links w/ target=_blank

Posted by simon <si...@chello.at>.
On Tue, 2007-12-11 at 08:37 -0800, Ryan Lubke wrote:
> 
> 
> Dave-53 wrote:
> > 
> > Hi Ryan,
> >    
> >   Thanks for help.  In web.xml,  we have
> >    
> >   <context-param>
> >   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
> >   <param-value>server</param-value>
> >   </context-param>
> >   
> >   <context-param>
> >   <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
> >   <param-value>20</param-value>
> >   </context-param> 
> >   
> >   <context-param>
> >   <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
> >   <param-value>true</param-value>
> >   </context-param> 
> >   
> >   <context-param>
> >   <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
> >   <param-value>false</param-value>
> >   </context-param> 
> >   
> > These parameters are not changed for RI,  I am wondering if I need to
> > change or add some for RI.
> >    
> >   Yes, I use <t:saveState> to save request-scope bean data. 
> >   The senarios:
> >    
> >   On window 1, click link A, execute action that changed request scope
> > bean data Foo, the response was shown on Window 2.  It worked well.
> >    
> >   Again on window 1, click link A, this step did not go through Invoke
> > Application phase.
> >    
> >   It works for MyFaces.
> >    
> >   Thanks for any help.
> >   Dave
> >   
> > 
> 
> Well, JBoss 4.2.2 uses JSF RI 1.2_04 P02.  Try upgrading to 1.2_06 [1], and
> set com.sun.faces.serializeServerState to true.
> We added the option to serialize component state to the session in 1.2_05. 
> 
> [1]
> https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderID=8346&expandFolder=8346&folderID=0
> 

Serializing the state (1) saves server memory, and (2) avoids ugly
surprises when an app is later clustered and suddenly it is realised
that objects in the component tree are not serializable.

Similarly for compressing the state, that just saves memory but should
have no effect on the app behaviour.

I cannot see what link there could be between either of these settings
and the described symptoms.

Cheers,

Simon


Re: Jboss 4.2.2 RI did not work for clicking links w/ target=_blank

Posted by Ryan Lubke <Ry...@Sun.COM>.


Dave-53 wrote:
> 
> Hi Ryan,
>    
>   Thanks for help.  In web.xml,  we have
>    
>   <context-param>
>   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
>   <param-value>server</param-value>
>   </context-param>
>   
>   <context-param>
>   <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
>   <param-value>20</param-value>
>   </context-param> 
>   
>   <context-param>
>   <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
>   <param-value>true</param-value>
>   </context-param> 
>   
>   <context-param>
>   <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
>   <param-value>false</param-value>
>   </context-param> 
>   
> These parameters are not changed for RI,  I am wondering if I need to
> change or add some for RI.
>    
>   Yes, I use <t:saveState> to save request-scope bean data. 
>   The senarios:
>    
>   On window 1, click link A, execute action that changed request scope
> bean data Foo, the response was shown on Window 2.  It worked well.
>    
>   Again on window 1, click link A, this step did not go through Invoke
> Application phase.
>    
>   It works for MyFaces.
>    
>   Thanks for any help.
>   Dave
>   
> 

Well, JBoss 4.2.2 uses JSF RI 1.2_04 P02.  Try upgrading to 1.2_06 [1], and
set com.sun.faces.serializeServerState to true.
We added the option to serialize component state to the session in 1.2_05. 

[1]
https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderID=8346&expandFolder=8346&folderID=0

-- 
View this message in context: http://www.nabble.com/Jboss-4.2.2-RI-did-not-work-for-clicking-links-w--target%3D_blank-tp14257806p14277790.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Jboss 4.2.2 RI did not work for clicking links w/ target=_blank

Posted by Dave <ja...@yahoo.com>.
Hi Ryan,
   
  Thanks for help.  In web.xml,  we have
   
  <context-param>
  <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
  <param-value>server</param-value>
  </context-param>
  
  <context-param>
  <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
  <param-value>20</param-value>
  </context-param> 
  
  <context-param>
  <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
  <param-value>true</param-value>
  </context-param> 
  
  <context-param>
  <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
  <param-value>false</param-value>
  </context-param> 
  
These parameters are not changed for RI,  I am wondering if I need to change or add some for RI.
   
  Yes, I use <t:saveState> to save request-scope bean data. 
  The senarios:
   
  On window 1, click link A, execute action that changed request scope bean data Foo, the response was shown on Window 2.  It worked well.
   
  Again on window 1, click link A, this step did not go through Invoke Application phase.
   
  It works for MyFaces.
   
  Thanks for any help.
  Dave
   
  
Ryan Lubke <Ry...@Sun.COM> wrote:
  


Dave-53 wrote:
> 
> Everything works fine for myfaces on Jboss 4.0.5GA. After I moved to
> JBoss 4.2.2 with faces RI. I got issues when clicking a command link with
> target=_blank. First time clicking the link is ok, but clicking the link
> again did not work, did not go to the Invoke Application phase to execute
> action. 
> 
> I suspect the RI did not serialize the request scope beans. So they are
> shared between requests.
> 
> What is the RI param for 
> org.apache.myfaces.SERIALIZE_STATE_IN_SESSION ?
> 
> Thanks for help!
> Dave
> 
> 
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo!
> Search.
> 

The RI (now Mojarra) takes no state saving action against request scoped
beans. They are valid for that request only, so they won't be shared.

Are you using something like t:saveState?

That said as of 1.2_05, we added com.sun.faces.serializeServerState to
serialize the component state prior to storing it in the session.


-- 
View this message in context: http://www.nabble.com/Jboss-4.2.2-RI-did-not-work-for-clicking-links-w--target%3D_blank-tp14257806p14264492.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.



       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

Re: Jboss 4.2.2 RI did not work for clicking links w/ target=_blank

Posted by Ryan Lubke <Ry...@Sun.COM>.


Dave-53 wrote:
> 
>   Everything works fine for myfaces on Jboss 4.0.5GA. After I moved to
> JBoss 4.2.2 with faces RI. I got issues when clicking a command link with
> target=_blank. First time clicking the link is ok, but clicking the link
> again did not work, did not go to the Invoke Application phase to execute
> action.  
>    
>   I suspect the RI did not serialize the request scope beans. So they are
> shared between requests.
>    
>   What is the RI param for 
>   org.apache.myfaces.SERIALIZE_STATE_IN_SESSION ?
>    
>   Thanks for help!
>   Dave
> 
>        
> ---------------------------------
> Looking for last minute shopping deals?  Find them fast with Yahoo!
> Search.
> 

The RI (now Mojarra) takes no state saving action against request scoped
beans.  They are valid for that request only, so they won't be shared.

Are you using something like t:saveState?

That said as of 1.2_05, we added com.sun.faces.serializeServerState to
serialize the component state prior to storing it in the session.


-- 
View this message in context: http://www.nabble.com/Jboss-4.2.2-RI-did-not-work-for-clicking-links-w--target%3D_blank-tp14257806p14264492.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Jboss 4.2.2 RI did not work for clicking links w/ target=_blank

Posted by Ryan Lubke <Ry...@Sun.COM>.


Simon Kitching-4 wrote:
> 
> 
> On Tue, 2007-12-11 at 08:32 -0800, Ryan Lubke wrote:
>> 
>> 
>> Simon Kitching-4 wrote:
>> > 
>> > 
>> > 
>> > If a postback occurs, and there is no matching cached view state
>> > available, then the postback effectively gets converted into a "get"
>> type
>> > request, ie no postback processing occurs and just the render phase
>> runs.
>> > There is no alternative here; postback processing cannot occur if the
>> > component tree cannot be recreated.
>> > 
>> > 
>> 
>> Actually, for 1.2, this should result in a ViewExpiredException.
> 
> Hmm..interesting. Thanks for the info.
> 
> There haven't been complaints from the userbase about this? While losing
> input data after too many back-buttons is bad, I'm not sure that showing
> an error page is better. It's a tough choice..
> 
> 
> 

There has been a couple of people I've worked with in the past that were
surprised
by the change.  



-- 
View this message in context: http://www.nabble.com/Jboss-4.2.2-RI-did-not-work-for-clicking-links-w--target%3D_blank-tp14257806p14278679.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Jboss 4.2.2 RI did not work for clicking links w/ target=_blank

Posted by simon <si...@chello.at>.
On Tue, 2007-12-11 at 08:32 -0800, Ryan Lubke wrote:
> 
> 
> Simon Kitching-4 wrote:
> > 
> > 
> > 
> > If a postback occurs, and there is no matching cached view state
> > available, then the postback effectively gets converted into a "get" type
> > request, ie no postback processing occurs and just the render phase runs.
> > There is no alternative here; postback processing cannot occur if the
> > component tree cannot be recreated.
> > 
> > 
> 
> Actually, for 1.2, this should result in a ViewExpiredException.

Hmm..interesting. Thanks for the info.

There haven't been complaints from the userbase about this? While losing
input data after too many back-buttons is bad, I'm not sure that showing
an error page is better. It's a tough choice..


Re: Jboss 4.2.2 RI did not work for clicking links w/ target=_blank

Posted by Ryan Lubke <Ry...@Sun.COM>.


Simon Kitching-4 wrote:
> 
> 
> 
> If a postback occurs, and there is no matching cached view state
> available, then the postback effectively gets converted into a "get" type
> request, ie no postback processing occurs and just the render phase runs.
> There is no alternative here; postback processing cannot occur if the
> component tree cannot be recreated.
> 
> 

Actually, for 1.2, this should result in a ViewExpiredException.



-- 
View this message in context: http://www.nabble.com/Jboss-4.2.2-RI-did-not-work-for-clicking-links-w--target%3D_blank-tp14257806p14277673.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.