users@glassfish.java.net

Prevent eval of JSF rendered attributes from previous page on PostBack?

From: <glassfish_at_javadesktop.org>
Date: Mon, 28 May 2007 14:39:45 PDT

We've developed a large JSF web app on Glassfish v1 and we're still struggling with this technology.

Because JSF doesn't support action methods on GET requests, our JSF backing bean getters use a lazy fetch pattern to initialize themselves. To optimize memory utilization, most of those beans are request scope. The way JSF works on POST submits though, I understand it posts back to the previous page and then navigate to the next page. The problem is that during initial phases on the previous page, it evaluates again the rendered attributes of components and this triggers our lazy fetch logic, even though this is totally wasteful, since we're navigating away from those UI components. Needless to say it results in very poor performance!

We tried to look for workarounds on the web and played around shielding our rendered attributes with isPostBack clauses hoping to bypass those evaluation on PostBack, but neither the JSF method, nor other creative implementation such as getRenderResponse() really works...

Has anyone encountered this problem or can think of how to work around it?
Are we supposed to always use session-scoped backing bean with JSF??
I'd appreciate any suggestion. :-)
[Message sent by forum member 'bouteill' (bouteill)]

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