users@javaserverfaces-spec-public.java.net

[jsr372-experts mirror] [jsr372-experts] Re: remove final from methods in UIComponent to make them proxyable in CDI

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Thu, 15 Dec 2016 18:25:54 +0100

Hi,

Components are indeed explicitly not injectable now. See also the overview
table here: http://arjan-tijms.omnifaces.org/p/jsf-23.html#1316

A little over a year ago I had been experimenting with this too, and what
it basically needs (besides, indeed removing the final modifiers), is what
I called a "FacesRequestScope".

This scope should be active during the process method of the FacesServlet
and would nest when includes are called, and furthermore changes when
forwards and navigates-without-redirect happen. I prototyped this earlier,
but as mentioned it's a year ago and at this stage it would be quite
challenging to get everything specified, implemented and tested.

I'd *really* like to see this in, but there's so little time left :(

Just removing the final modifiers may be doable though.

Kind regards,
Arjan






On Thu, Dec 15, 2016 at 8:34 AM, Cagatay Civici <cagatay.civici_at_gmail.com>
wrote:

> Agreed,
>
> There are so many users who suffer from this issue for years, fixing this
> will be great.
>
> Regards,
>
> Cagatay Civici
> PrimeTek
>
> On Thursday, 15 December 2016 at 10:14, Leonardo Uribe wrote:
>
> Hi
>
> I forgot to mention why this is really wanted. If UIComponents are CDI
> proxyable we could make
> "binding" attribute to inject a CDI UIComponent proxy and solve the
> problem when
> UIComponent instances are inside session scope beans once for all. That
> could be a big step
> forward for JSF.
>
> regards,
>
> Leonardo Uribe
>
> 2016-12-15 1:59 GMT-05:00 Leonardo Uribe <leonardo.uribe_at_irian.at>:
>
> Hi
>
> I'm exploring the posibility of make UIComponent instances CDI injectable
> for JSF 2.3, and I have found that some final methods in UIComponent
> creates a conflict:
>
> public final Map<String,Object> getPassThroughAttributes()
> public final TransientStateHelper getTransientStateHelper()
> public final void popComponentFromEL(FacesContext context)
> public final void pushComponentToEL(FacesContext context, UIComponent
> component)
>
> Can't we just remove the "final" modifier here? I know that in these cases
> it makes sense, but make UIComponent instances injectable in CDI seems to
> be a winning
> proposition to me.
>
> According to the table UIViewRoot is planned to be injectable, but I do
> not see how to do it properly without this change.
>
> WDYT?
>
> regards,
>
> Leonardo Uribe
>
>
>
>