开发者

JSF Controller Bean - Scoping

开发者 https://www.devze.com 2023-04-07 09:59 出处:网络
WI have a question about the \"Best Practice\" Design for controller beans. I was reading this very good question and the linking arti开发者_JS百科cle:

WI have a question about the "Best Practice" Design for controller beans.

I was reading this very good question and the linking arti开发者_JS百科cle:

Question "JSF backing bean structure (best practices)" Scoping Best Practice

Online Article Distinctions between different kinds of JSF Managed-beans

My question is concerning the controller bean. I'm using JSF / Spring and was wondering why I would want to use request scope for Controller beans?

The controller logic being defined as "...execute some kind of business logic and return navigation outcome.." I would think doesn't require a request scope but either session/application scope. Why keep creating those controller objects on every request?

In my case I would create the controller bean in the faces-config obviously and inject it with my managed properties through spring.

Thoughts please around the scoping? Thanks.

Clarification: Using JSF 1.2, Spring 3. Using faces-config.xml to declare my beans. Not through annotations.

0

精彩评论

暂无评论...
验证码 换一张
取 消