users@jax-rs-spec.java.net

[jax-rs-spec users] Re: [jsr339-experts] MVC

From: Edward Burns <edward.burns_at_oracle.com>
Date: Wed, 4 Jun 2014 09:36:33 -0700

>>>>> On Wed, 4 Jun 2014 01:15:01 +0200, arjan tijms <arjan.tijms_at_gmail.com> said:

[...]

SP> No, form processing, for example, could potentially be very different to
SP> JSF in this framework.
SP>

AT> I know, but what I meant is that Facelets as it is depends on core JSF
AT> classes one way of the other.

AT> Form processing, and then specifically the way in which the postback from
AT> components could be handled in a controller that hasn't seen the view yet
AT> (or will never see it) is a challenging task. I had some lengthy
AT> discussions with Manfred from the Mojarra team about this very topic.

AT> The thing is that all current components are written under the assumption
AT> that their postback variables, both the names of the variables and its
AT> content, are private to the component. For quite a lot of components,
AT> especially the standard ones in JSF like h:inputText the name is very
AT> predictable and the value is extremely simple (whatever the user gave as
AT> input). This is thus not that difficult to process, but in general one can
AT> not make that assumption as it are private variables one way or the other
AT> and can theoretically change at any time between releases of a component.

AT> That said, there is in JSF already a mechanism that controls the decoding,
AT> namely the Renderer. See
AT> http://docs.oracle.com/javaee/7/api/javax/faces/render/Renderer.html
AT> (perhaps a better name for this class would have been EncoderDecoder or
AT> something).

AT> At any length, this particular class embeds all the knowledge that's needed
AT> to decode parameters from the request. It may need some more brainstorming,
AT> but with a small modification to this class and an addition to the ID
AT> generation code for components, it might be quite doable to "manually"
AT> extract the data posted by existing components without needing the original
AT> view.

First, let me say how glad I am that the energy from the discussion on
users_at_javaserverfaces-spec-public has been rekindled here.

Arjan, you are describing the single most essential concept of JSF. I
think it would be a mistake to carry this concept forward into JAX-RS
MVC. The action oriented MVC programming model does not have such a
notion and to introduce it would be making it a different programming
model.

Ed

-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| 19 business days til Santa Clara trip