官术网_书友最值得收藏!

How it works...

The main actor in this whole scenario is the Models class injected into the Controller, shown as follows:

@Inject
Models models;

It's a class from MVC 1.0 API that has the responsibility, in this recipe, of letting the User object to be available for the View layer. It's injected (using CDI) and uses another injected bean, userBean, to do it:

models.put("user", userBean.getUser());

So, the View can easily access the values from the User object using expression language as follows:

<h1>${user.name}/${user.email}</h1>
主站蜘蛛池模板: 绵竹市| 平乐县| 五常市| 钟祥市| 买车| 岳阳县| 大名县| 禄劝| 莲花县| 米易县| 张家口市| 宜城市| 留坝县| 静安区| 萍乡市| 临海市| 鄂托克旗| 莱州市| 旬邑县| 岗巴县| 金平| 屯留县| 潞城市| 介休市| 江城| 卓资县| 固镇县| 滦平县| 稻城县| 华宁县| 尼玛县| 巴彦淖尔市| 凤冈县| 南丰县| 海门市| 武乡县| 楚雄市| 贵溪市| 关岭| 泸水县| 宁德市|