Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faces 4.1: Deprecate full state saving (FSS) #1829

Closed
arjantijms opened this issue Jul 22, 2023 · 7 comments
Closed

Faces 4.1: Deprecate full state saving (FSS) #1829

arjantijms opened this issue Jul 22, 2023 · 7 comments
Assignees
Labels
mojarra-implemented API issue implemented by Mojarra myfaces-implemented API issue implemented by MyFaces Remove legacy
Milestone

Comments

@arjantijms
Copy link
Contributor

Full state saving is widely considered to be a historical mistake in Faces. Indeed, in old meeting minutes from before Faces (JSF) 1.0 it was already brought to the table that putting everything that static on the view description also in the state would be a monumental waste of resources.

We should have deprecated this a long time ago, but we simply forgot it every release.

Let's not forget this anymore, and let's actually deprecate (for removal) FFS.

@arjantijms arjantijms added this to the 4.1 milestone Jul 22, 2023
@arjantijms arjantijms self-assigned this Jul 22, 2023
@BalusC BalusC changed the title Deprecate full state saving (FSS) Faces 4.1: Deprecate full state saving (FSS) Jul 22, 2023
@BalusC
Copy link
Member

BalusC commented Jul 23, 2023

I like the FFS pun there :)

@BalusC
Copy link
Member

BalusC commented Jul 23, 2023

For the record, these are the context params warranting removal as well

  • jakarta.faces.PARTIAL_STATE_SAVING
  • jakarta.faces.FULL_STATE_SAVING_VIEW_IDS

@tandraschko
Copy link

should we add a warning on startup when running with that configs?

@VsevolodGolovanov
Copy link

We have FSS enabled since ancient times because of cases like this (using PrimeFaces):

<p:tabView dynamic="true">
	<p:tab>
		<p:dataTable>
			<p:columns value="#{expression}">

State saving doesn't know about the dynamic attribute, so after rendering it executes expression which could be a heavy lazy loaded model, or it could depend on some prerequisites that haven't been satisfied.

at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]
at javax.faces.component.UIData.getValue(UIData.java:732) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]
at org.primefaces.component.api.UIData.getDataModel(UIData.java:629) [primefaces-5.0.jar:5.0]
at javax.faces.component.UIData.getRowCount(UIData.java:356) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]
...
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]
at com.sun.faces.application.view.FaceletPartialStateManagementStrategy.saveView(FaceletPartialStateManagementStrategy.java:472) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:89) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:478) [jsf-impl-2.2.5-jbossorg-3.jar:]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) [jsf-impl-2.2.5-jbossorg-3.jar:]

Storing the whole state is less costly than working around this.

Maybe this case is considered in newer JSF & PF versions? In JSF 2.2 the only way a component could affect state saving tree walking is by overriding isTransient, and I'm not sure that would work here, because TabView would have to somehow know if it was dynamically rendered or not, which is kept in its state, before restoring the view.

@tandraschko
Copy link

tandraschko commented Aug 29, 2023

@VsevolodGolovanov try to create a reproducer with latest PF and create a primefaces issue; might already be fixed

@tandraschko tandraschko added the myfaces-implemented API issue implemented by MyFaces label Oct 4, 2023
@tandraschko
Copy link

apache/myfaces@f9aaff9

BalusC added a commit to eclipse-ee4j/mojarra that referenced this issue Oct 15, 2023
@BalusC BalusC added the mojarra-implemented API issue implemented by Mojarra label Oct 21, 2023
@BalusC
Copy link
Member

BalusC commented Oct 21, 2023

Now in Mojarra as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mojarra-implemented API issue implemented by Mojarra myfaces-implemented API issue implemented by MyFaces Remove legacy
Projects
None yet
Development

No branches or pull requests

4 participants