- 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>
推薦閱讀
- Java Web開發學習手冊
- SQL Server 2016從入門到精通(視頻教學超值版)
- Building Cross-Platform Desktop Applications with Electron
- Python機器學習算法與實戰
- iOS編程基礎:Swift、Xcode和Cocoa入門指南
- Gradle for Android
- Integrating Facebook iOS SDK with Your Application
- Creating Mobile Apps with jQuery Mobile(Second Edition)
- CoffeeScript Application Development Cookbook
- 智能搜索和推薦系統:原理、算法與應用
- 快速入門與進階:Creo 4·0全實例精講
- R數據科學實戰:工具詳解與案例分析
- Python大學實用教程
- 計算機應用基礎項目化教程
- Web前端開發最佳實踐