I am new to JSF and I am using JSF Custom components in my application.
My backingbean is in View Scope.Everytime I am getting new instance of my components.
Sometimes I am getting two multiple instances for single component as siblings causing error as

If I put bean in Session scope then it will cause performance issue.
Please suggest.What to do?

Please guide or help me on this issue.

09-05-2013, 11:29 AM

gimbal2

Re: Understanding of state saving in JSF

But you don't even mention the version of JSF you're using.

09-05-2013, 11:32 AM

minakshi

Re: Understanding of state saving in JSF

I am sorry. We are using JSF 2.1 version

09-05-2013, 01:11 PM

gimbal2

Re: Understanding of state saving in JSF

Okay, but your question is still very unclear. You mention custom components, state saving and using different scopes. What in all that is the actual problem you are experiencing. I don't think you have one specific one, I think you have multiple problems that all stem from not understanding entirely how JSF ticks. And that is a hard requirement before you can actually properly use JSF - you need to technically understand how it does the things it does, very well. Its one of the major downsides I tag to the framework and why I don't advise it to beginners.

Duplicate IDs for example can have multiple sources. Sometimes it is caused by Ajax rerendering actions, sometimes it is caused by improper use of JSTL tags, sometimes it is caused by two components in fact getting the same ID and it will "randomly" show up when you conditionally render both of them. There is no clear cut reason and solution to that, you have to keep looking for something that -may- be wrong in your application and then prove that it is in fact wrong. When you have found that you have reached the point where you can start asking for help because then you have something to show.