Hi,
Recently I ran Findbugs against my project. In managed beans with scope larger than request, the following bad practice is recognized:
... defines non-transient non-serializable instance field ...
There are a few problematic PF classes like UploadedFile and DataTable. They don't implement java.io.Serializable. How can I use them in view or session scope beans safely?
Marcin
Beans with scope longer than request and serialization
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Hi,
DefaultUploadedFile class implements Serializable for datatable JSF components do not implement Serializable since it is not a good practice to use component binding on scopes longer than request.
DefaultUploadedFile class implements Serializable for datatable JSF components do not implement Serializable since it is not a good practice to use component binding on scopes longer than request.
Hi Cagaty
1. I agree that binding components to beans with longer lifecycle than request should be avoided.
2. FileUploadEvent uses UploadedFile interface (which is correct) not DefaultUploadedFile class. UploadedFile interface should extend Serializable directly, IMHO.
Marcin
1. I agree that binding components to beans with longer lifecycle than request should be avoided.
2. FileUploadEvent uses UploadedFile interface (which is correct) not DefaultUploadedFile class. UploadedFile interface should extend Serializable directly, IMHO.
Marcin
JSF RI 2.0.3
PF 2.2.M1
Glassfish 3.0.1
PF 2.2.M1
Glassfish 3.0.1
-
- Information
-
Who is online
Users browsing this forum: Google [Bot] and 35 guests