webtier@glassfish.java.net

Re: How to avoid _at_PostConstruct on page Faces beans during postback?

From: <webtier_at_javadesktop.org>
Date: Tue, 14 Apr 2009 16:05:35 PDT

I understand a commandLink also technically submits an h:form. I was just wondering if there was a way to make it behave such as to not re-instantiate beans on the hosting page that have nothing to do with the postback.
The h:form in this use case is dedicated to the commandLink. There is [b]nothing else[/b] in it. There is no reference to myFB, not even in the commandLink. Yet Mojarra still re-instantiate all the beans referenced on that page...

As I responded to Lincoln, caching beans is a workaround but it would also increase memory requirements and require flush considerations for things which should really just be request based... It's not better than prerender IMHO.

I'll refrain from commenting on the arrogant last paragraph, but re: GETs, that's what we do right now and this is also unsatisfactory in that:
1) if you have multiple actions for the URL, you end up with an ugly if/else/if/else/etc. in prerender
2) it forces you to navigate before you know the result of the action
JSF command framework is great, I was just looking for an optimized version for form-less action use cases, but I guess this doesn't exist yet...
[Message sent by forum member 'bouteill' (bouteill)]

http://forums.java.net/jive/thread.jspa?messageID=342173