多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## 实体类 ~~~ package com.like.domain; import java.io.Serializable; public class User implements Serializable { private String username; private String password; private Integer age; @Override public String toString() { return "User{" + "username='" + username + '\'' + ", password='" + password + '\'' + ", age=" + age + '}'; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } } ~~~ 方法: ~~~ @RequestMapping(path = "/ok") public String testResponse(Model model) { System.out.println("hello"); User user = new User(); user.setUsername("jack"); user.setPassword("123"); user.setAge(20); model.addAttribute("user", user); return "success"; } ~~~ jsp: ~~~ <%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %> <html> <head> <title>Title</title> </head> <body> ${user.username} ${user.password} ${user.age} </body> </html> ~~~