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

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>
主站蜘蛛池模板: 潼南县| 景泰县| 江安县| 门源| 浮梁县| 衡东县| 台东市| 阿尔山市| 定兴县| 崇信县| 城口县| 凤阳县| 钦州市| 彰武县| 冕宁县| 仙桃市| 华池县| 新绛县| 高陵县| 鹿邑县| 泗水县| 当雄县| 云林县| 玛多县| 光山县| 德令哈市| 柳河县| 勐海县| 荆门市| 乌兰察布市| 桐柏县| 莱州市| 夏津县| 罗源县| 东乌珠穆沁旗| 高邮市| 德庆县| 仙桃市| 江门市| 焦作市| 观塘区|