Mojara 2.1.21
I\'ve updated my question based on comments. I have two situation where a component is bound to server session bean. (Additional links with information
In JSF 2.x, unless you want to manipulate components programmatically (which is at its own also rather fishy), there is no sensible real world use case to bind components to a backing bean. For sure not if they are further not been used in the backing bean itself, or if it are solely their attributes which are been flattened out.
As to the functional requirement of getting the current row of the data table, there are much better ways listed here, How can I pass selected row to commandLink inside dataTable?, for example if your environment supports EL 2.2:
The two last requirements are totally unclear. At least, if you're doing something like:
with in bean
someComponent.setSomeAttribute(someAttribute);
someComponent.setOtherAttribute(otherAttribute);
then you should instead be doing
Or, if you intend to be able to use the component somewhere else in the view like so
...
and the instance is further nowhere been used in the bean, then just get rid of the unnecessary property altogether:
...
If there is really, really no way for some unclear reason, then split all request scoped properties of the session scoped bean out into a separate request scoped bean which you in turn bind to form actions. The session scoped one can just be injected as a @ManagedProperty of the request scoped one.