- Jakarta EE Cookbook
- Elder Moraes
- 83字
- 2021-06-24 16:12:42
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>
推薦閱讀
- TypeScript入門與實(shí)戰(zhàn)
- Visual C++程序設(shè)計(jì)學(xué)習(xí)筆記
- Building a RESTful Web Service with Spring
- 實(shí)用防銹油配方與制備200例
- 概率成形編碼調(diào)制技術(shù)理論及應(yīng)用
- 信息技術(shù)應(yīng)用基礎(chǔ)
- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- Visual C#通用范例開發(fā)金典
- Python Data Science Cookbook
- C++ Fundamentals
- 鴻蒙OS應(yīng)用編程實(shí)戰(zhàn)
- 自學(xué)Python:編程基礎(chǔ)、科學(xué)計(jì)算及數(shù)據(jù)分析(第2版)
- SEO教程:搜索引擎優(yōu)化入門與進(jìn)階(第3版)
- LabVIEW入門與實(shí)戰(zhàn)開發(fā)100例(第4版)
- Go Systems Programming