开发者

Automatic Bean Creation

开发者 https://www.devze.com 2023-01-28 23:36 出处:网络
Question: will using FacesContext context = FacesContext.getCurrentInstance(); Bean bean开发者_如何学Go = (Bean) context.getApplication().evaluateExpressionGet(context, \"#{bean}\", Bean.class);

Question: will using

FacesContext context = FacesContext.getCurrentInstance();
Bean bean开发者_如何学Go = (Bean) context.getApplication().evaluateExpressionGet(context, "#{bean}", Bean.class);

cause a new Bean to be instantiated each time the code runs through these statements? Or will it simply refer to the same instance initially created?


It will only create one if not already created yet in the current request/session/application.

0

精彩评论

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