Here are the examples of the java api org.springframework.ui.Model taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
5958 Examples
19
View Source File : MerchantController.java
License : MIT License
Project Creator : zzzzbw
License : MIT License
Project Creator : zzzzbw
@I18n("merchant")
@GetMapping
public String index(Model model) {
List<Merchant> list = new ArrayList<>();
for (int i = 0; i < 10; i++) {
Merchant merchant = new Merchant();
merchant.setId(i);
merchant.setNumber(1000 + i);
merchant.setName("Merchant" + i);
merchant.setCreate(new Date());
list.add(merchant);
}
model.addAttribute("list", list);
return "system/merchant";
}
19
View Source File : DashboardController.java
License : MIT License
Project Creator : zzzzbw
License : MIT License
Project Creator : zzzzbw
@GetMapping
public String dashboard(Model model) {
List<Merchant> merchants = new ArrayList<>();
for (int i = 0; i < 10; i++) {
Merchant merchant = new Merchant();
merchants.add(merchant);
}
List<Shop> shops = new ArrayList<>();
for (int i = 0; i < 15; i++) {
Shop shop = new Shop();
shops.add(shop);
}
List<User> users = new ArrayList<>();
for (int i = 0; i < 5; i++) {
User user = new User();
users.add(user);
}
model.addAttribute("merchants", merchants);
model.addAttribute("shops", shops);
model.addAttribute("users", users);
return "system/dashboard";
}
19
View Source File : DubboServiceConsumeController.java
License : Apache License 2.0
Project Creator : zq2599
License : Apache License 2.0
Project Creator : zq2599
@RequestMapping("/postadd")
public String postadd(HttpServletRequest request, Model model) {
int param0 = Tools.getInt(request, "param0", 0);
int param1 = Tools.getInt(request, "param1", 0);
model.addAttribute("calcRlt", String.valueOf(calculateService.add(param0, param1)));
model.addAttribute("rpcFrom", platformService.getRpcFrom());
addCommon(model);
return "add_finish";
}
19
View Source File : SecAdminController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
@RequiresPermissions("sys:secAdmin:view")
@RequestMapping(value = "list")
public String list(User user, Model model) {
return "modules/sys/user/secAdminList";
}
19
View Source File : EmpUserController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
/**
* 选择员工对话框
*/
@RequiresPermissions("user")
@RequestMapping(value = "empUserSelect")
public String empUserSelect(EmpUser empUser, String selectData, String checkbox, Model model) {
String selectDataJson = EncodeUtils.decodeUrl(selectData);
if (JsonMapper.fromJson(selectDataJson, Map.clreplaced) != null) {
model.addAttribute("selectData", selectDataJson);
}
// 是否显示复选框,支持多选
model.addAttribute("checkbox", checkbox);
// ModelAttribute
model.addAttribute("empUser", empUser);
return "modules/sys/user/empUserSelect";
}
19
View Source File : EmpUserController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
/**
* 用户授权数据权限
*/
@RequiresPermissions("sys:empUser:authDataScope")
@RequestMapping(value = "formAuthDataScope")
public String formAuthDataScope(EmpUser empUser, Model model, HttpServletRequest request) {
UserDataScope userDataScope = new UserDataScope();
userDataScope.setUserCode(empUser.getUserCode());
userDataScope.setCtrlPermi(UserDataScope.CTRL_PERMI_HAVE);
List<UserDataScope> userDataScopeList = userService.findDataScopeList(userDataScope);
model.addAttribute("userDataScopeList", userDataScopeList);
model.addAttribute("empUser", empUser);
return "modules/sys/user/empUserFormAuthDataScope";
}
19
View Source File : EmpUserController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
@RequiresPermissions("sys:empUser:view")
@RequestMapping(value = "list")
public String list(EmpUser empUser, Model model) {
// 获取岗位列表
Post post = new Post();
model.addAttribute("postList", postService.findList(post));
return "modules/sys/user/empUserList";
}
19
View Source File : EmpUserController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
@RequiresPermissions("sys:empUser:view")
@RequestMapping(value = "index")
public String index(EmpUser empUser, Model model) {
return "modules/sys/user/empUserIndex";
}
19
View Source File : CorpAdminController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
@RequiresPermissions("sys:corpAdmin:view")
@RequestMapping(value = "list")
public String list(User user, Model model) {
user.setCorpCode(null);
user.setCorpName(null);
return "modules/sys/user/corpAdminList";
}
19
View Source File : CorpAdminController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
@RequiresPermissions("sys:corpAdmin:view")
@RequestMapping(value = "form")
public String form(User user, String op, Model model) {
if (user.getIsNewRecord()) {
// 新增租户管理员,如果已存在,则不能保存
if ("addCorp".equals(op)) {
// 租户代码
user.setCorpCode_(StringUtils.EMPTY);
// 租户名称
user.setCorpName_(StringUtils.EMPTY);
}
}
// 操作类型:addCorp: 添加租户; addAdmin: 添加管理员; edit: 编辑
model.addAttribute("op", op);
model.addAttribute("user", user);
return "modules/sys/user/corpAdminForm";
}
19
View Source File : AccountController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
/**
* 忘记密码页面
*/
@RequestMapping(value = "forgetPwd")
public String forgetPwd(Model model) {
model.addAttribute("message", "正在研发中,敬请期待!");
return "modules/sys/account/forgetPwd";
}
19
View Source File : OnlineController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
/**
* 在线用户列表
* @param request
* @param response
* @param model
*/
@RequiresPermissions("sys:online:view")
@RequestMapping(value = "list")
public String list(Model model) {
return "modules/sys/onlineList";
}
19
View Source File : OfficeController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
/**
* 机构列表
* @param office
*/
@RequiresPermissions("sys:office:view")
@RequestMapping(value = "list")
public String list(Office office, Model model) {
model.addAttribute("office", office);
return "modules/sys/officeList";
}
19
View Source File : LoginController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
/**
* 个人桌面页面
*/
@RequiresPermissions("user")
@RequestMapping(value = "desktop")
public String desktop(HttpServletRequest request, HttpServletResponse response, Model model) {
return "modules/sys/sysDesktop";
}
19
View Source File : AreaController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
/**
* 查看编辑区域
* @param area
*/
@RequiresPermissions("sys:area:view")
@RequestMapping(value = "form")
public String form(Area area, Model model) {
// 创建并初始化下一个节点信息
area = createNextNode(area);
model.addAttribute("area", area);
return "modules/sys/areaForm";
}
19
View Source File : AreaController.java
License : MIT License
Project Creator : Zo3i
License : MIT License
Project Creator : Zo3i
/**
* 区域列表
* @param area
*/
@RequiresPermissions("sys:area:view")
@RequestMapping(value = "list")
public String list(Area area, Model model) {
return "modules/sys/areaList";
}
19
View Source File : IndexController.java
License : Apache License 2.0
Project Creator : zlt2000
License : Apache License 2.0
Project Creator : zlt2000
@RequestMapping("/toLogin")
@PermessionLimit(limit = false)
public String toLogin(Model model, HttpServletRequest request) {
if (PermissionInterceptor.ifLogin(request)) {
return "redirect:/";
}
return "login";
}
19
View Source File : UserConteroller.java
License : Apache License 2.0
Project Creator : zhupanlinch
License : Apache License 2.0
Project Creator : zhupanlinch
@GetMapping("edit")
public String edit(Long id, Model model) {
User user = userService.findUserById(id);
List<Long> roleIdList = Lists.newArrayList();
if (user != null) {
Set<Role> roleSet = user.getRoleLists();
if (roleSet != null && roleSet.size() > 0) {
for (Role r : roleSet) {
roleIdList.add(r.getId());
}
}
}
List<Role> roleList = roleService.selectAll();
model.addAttribute("localuser", user);
model.addAttribute("roleIds", roleIdList);
model.addAttribute("roleList", roleList);
return "admin/system/user/edit";
}
19
View Source File : UserConteroller.java
License : Apache License 2.0
Project Creator : zhupanlinch
License : Apache License 2.0
Project Creator : zhupanlinch
@GetMapping("userinfo")
public String toEditMyInfo(Model model) {
Long userId = MySysUser.id();
User user = userService.findUserById(userId);
model.addAttribute("userinfo", user);
model.addAttribute("userRole", user.getRoleLists());
return "admin/system/user/userInfo";
}
19
View Source File : UserConteroller.java
License : Apache License 2.0
Project Creator : zhupanlinch
License : Apache License 2.0
Project Creator : zhupanlinch
@GetMapping("add")
public String add(Model model) {
List<Role> roleList = roleService.selectAll();
model.addAttribute("roleList", roleList);
return "admin/system/user/add";
}
19
View Source File : QuartzTaskController.java
License : Apache License 2.0
Project Creator : zhupanlinch
License : Apache License 2.0
Project Creator : zhupanlinch
@GetMapping("edit")
public String edit(Long id, Model model) {
QuartzTask quartzTask = quartzTaskService.selectById(id);
model.addAttribute("quartzTask", quartzTask);
return "/admin/quartzTask/edit";
}
19
View Source File : ErpUserResumeController.java
License : Apache License 2.0
Project Creator : zhupanlinch
License : Apache License 2.0
Project Creator : zhupanlinch
@GetMapping("edit")
@SysLog("跳转编辑系统分配给用户的简历页面")
public String edit(Long id, Model model) {
ErpUserResume erpUserResume = erpUserResumeService.selectById(id);
model.addAttribute("erpUserResume", erpUserResume);
return "/admin/erpUserResume/edit";
}
19
View Source File : ErpTeamMemberController.java
License : Apache License 2.0
Project Creator : zhupanlinch
License : Apache License 2.0
Project Creator : zhupanlinch
@GetMapping("add")
@SysLog("跳转新增管理小组页面")
public String add(Model model) {
// 所有人员
EnreplacedyWrapper<User> userEnreplacedyWrapper = new EnreplacedyWrapper<>();
List<User> userList = userService.selectList(userEnreplacedyWrapper);
model.addAttribute("userList", userList);
return "/admin/erpTeamMember/add";
}
19
View Source File : ErpTeamMemberController.java
License : Apache License 2.0
Project Creator : zhupanlinch
License : Apache License 2.0
Project Creator : zhupanlinch
@GetMapping("edit")
@SysLog("跳转编辑管理小组页面")
public String edit(Long id, Model model) {
ErpTeamMember erpTeamMember = erpTeamMemberService.selectById(id);
model.addAttribute("erpTeamMember", erpTeamMember);
// 所有人员
EnreplacedyWrapper<User> userEnreplacedyWrapper = new EnreplacedyWrapper<>();
List<User> userList = userService.selectList(userEnreplacedyWrapper);
model.addAttribute("userList", userList);
return "/admin/erpTeamMember/edit";
}
19
View Source File : ErpResumeController.java
License : Apache License 2.0
Project Creator : zhupanlinch
License : Apache License 2.0
Project Creator : zhupanlinch
@GetMapping("add")
@SysLog("跳转新增简历表页面")
public String add(Model model) {
// 所有标签
List<ErpTag> tags = erpTagService.listAll();
model.addAttribute("tags", tags);
// 查询自己的项目,将自己的项目设置到简历的招聘项目中
EnreplacedyWrapper<ErpProject> wrapper = new EnreplacedyWrapper<ErpProject>();
wrapper.eq("del_flag", false);
wrapper.exists("select 1 from erp_project_user where project_id = erp_project.id and user_id= " + getCurrentUser().getId() + " ");
List<ErpProject> projects = erpProjectService.selectList(wrapper);
model.addAttribute("projects", projects);
return "/admin/erpResume/add";
}
19
View Source File : BlogArticleController.java
License : Apache License 2.0
Project Creator : zhupanlinch
License : Apache License 2.0
Project Creator : zhupanlinch
@GetMapping("edit")
public String edit(Long id, Model model) {
BlogArticle blogArticle = blogArticleService.selectOneDetailById(id);
model.addAttribute("blogArticle", blogArticle);
List<ZtreeVO> list = blogChannelService.selectZtreeData();
model.addAttribute("ztreeData", JSONObject.toJSONString(list));
List<BlogTags> blogTags = blogTagsService.listAll();
model.addAttribute("taglist", blogTags);
return "/admin/blogArticle/edit";
}
19
View Source File : BlogArticleController.java
License : Apache License 2.0
Project Creator : zhupanlinch
License : Apache License 2.0
Project Creator : zhupanlinch
@GetMapping("add")
public String add(@RequestParam(value = "channelId", required = false) Long channelId, Model model) {
BlogChannel blogChannel = blogChannelService.selectById(channelId);
if (blogChannel != null) {
model.addAttribute("channel", blogChannel);
}
List<ZtreeVO> list = blogChannelService.selectZtreeData();
model.addAttribute("ztreeData", JSONObject.toJSONString(list));
List<BlogTags> blogTags = blogTagsService.listAll();
model.addAttribute("taglist", blogTags);
return "/admin/blogArticle/add";
}
19
View Source File : ProductController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/")
public String useT(Model model, HttpServletRequest request, HttpServletResponse response) {
// 获取所有的商品
List<Product> allProducts = productService.findAll();
model.addAttribute("prods", allProducts);
// 获取当前日期
model.addAttribute("today", Calendar.getInstance());
// 设置访问用户信息到session
request.getSession(true).setAttribute("user", new User("桌前", "明月", "CHINA", null));
localeResolver.setLocale(request, response, Locale.CHINA);
return "productList";
}
19
View Source File : LayoutController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/index2")
public String index2(Model model) {
return "/layout/index2";
}
19
View Source File : LayoutController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/index")
public String index(Model model) {
return "/layout/index";
}
19
View Source File : ThymeleafHelloWrodController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/thymeleaf")
public String helloThymeleaf(Model model) {
model.addAttribute("hello", "hello Thymeleaf!");
return "hello/index";
}
19
View Source File : CourseController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/thaction")
public String thaction(Model model) {
return "/course/thaction";
}
19
View Source File : CourseController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/thclreplaced")
public String thclreplaced(Model model) {
return "/course/thclreplaced";
}
19
View Source File : CourseController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/bools")
public String bools(Model model) {
return "/course/bools";
}
19
View Source File : CourseController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/thsrc")
public String thsrc(Model model) {
return "/course/thsrc";
}
19
View Source File : CourseController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/ids")
public String ids(Model model) {
return "/course/ids";
}
19
View Source File : CourseController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/thonclick")
public String honclick(Model model) {
return "/course/thonclick";
}
19
View Source File : HelloWorldController.java
License : Apache License 2.0
Project Creator : zhuoqianmingyue
License : Apache License 2.0
Project Creator : zhuoqianmingyue
@RequestMapping("/test")
public String test(Model model) {
model.addAttribute("msg", "SpringBoot With Freemark hello world!");
return "test/helloworld";
}
19
View Source File : RegisterController.java
License : GNU General Public License v3.0
Project Creator : zhshuixian
License : GNU General Public License v3.0
Project Creator : zhshuixian
@RequestMapping("/register-save")
public String registerSave(@ModelAttribute SysUser sysUser, Model model) {
// 判断 username preplacedword 不能为空
if (sysUser.getUsername() == null || sysUser.getPreplacedword() == null || sysUser.getUserRole() == null) {
model.addAttribute("error", true);
return "register";
}
try {
// 密码加密存储
BCryptPreplacedwordEncoder bCryptPreplacedwordEncoder = new BCryptPreplacedwordEncoder();
String preplacedword = bCryptPreplacedwordEncoder.encode(sysUser.getPreplacedword());
sysUser.setPreplacedword(preplacedword);
// 写入数据库
sysUserMapper.insert(sysUser);
return "redirect:/login";
} catch (Exception e) {
model.addAttribute("error", true);
return "register";
}
}
19
View Source File : JSPController.java
License : Apache License 2.0
Project Creator : ZHENFENG13
License : Apache License 2.0
Project Creator : ZHENFENG13
@RequestMapping("/hello")
public String hello(Model model) {
model.addAttribute("info", "Spring Boot 整合 JSP");
return "hello";
}
19
View Source File : NotificationUtilsTest.java
License : Apache License 2.0
Project Creator : zhcet-amu
License : Apache License 2.0
Project Creator : zhcet-amu
public clreplaced NotificationUtilsTest {
private Page page;
private Model model;
@Before
public void setUp() {
page = mock(Page.clreplaced);
model = new ExtendedModelMap();
}
@Test
public void testNormalizePageNull() {
replacedertThat(NotificationUtils.normalizePage(null), equalTo(1));
}
@Test
public void testNormalizePageLowerBound() {
replacedertThat(NotificationUtils.normalizePage(0), equalTo(1));
replacedertThat(NotificationUtils.normalizePage(-1), equalTo(1));
replacedertThat(NotificationUtils.normalizePage(-20), equalTo(1));
}
@Test
public void testNormalizePageUpperBound() {
replacedertThat(NotificationUtils.normalizePage(1), equalTo(1));
replacedertThat(NotificationUtils.normalizePage(24), equalTo(24));
}
@Test
public void testGetSafePage() {
replacedertThat(NotificationUtils.getSafePage(-1, 20), equalTo(1));
replacedertThat(NotificationUtils.getSafePage(0, 2), equalTo(1));
replacedertThat(NotificationUtils.getSafePage(1, 0), equalTo(1));
replacedertThat(NotificationUtils.getSafePage(-19, 3), equalTo(1));
replacedertThat(NotificationUtils.getSafePage(12, 20), equalTo(12));
replacedertThat(NotificationUtils.getSafePage(15, 10), equalTo(10));
}
@Test
public void testSetupModelPageLower() {
when(page.getTotalPages()).thenReturn(20);
NotificationUtils.prepareNotifications(model, page, 2);
Map<String, Object> map = model.asMap();
replacedertThat(map.get("minPage"), equalTo(1));
replacedertThat(map.get("maxPage"), equalTo(7));
replacedertThat(map.get("currentPage"), equalTo(2));
}
@Test
public void testSetupModelPageUpper() {
when(page.getTotalPages()).thenReturn(20);
NotificationUtils.prepareNotifications(model, page, 17);
Map<String, Object> map = model.asMap();
replacedertThat(map.get("minPage"), equalTo(12));
replacedertThat(map.get("maxPage"), equalTo(20));
replacedertThat(map.get("currentPage"), equalTo(17));
}
@Test
public void testSetupModelPageInner() {
when(page.getTotalPages()).thenReturn(20);
NotificationUtils.prepareNotifications(model, page, 9);
Map<String, Object> map = model.asMap();
replacedertThat(map.get("minPage"), equalTo(4));
replacedertThat(map.get("maxPage"), equalTo(14));
replacedertThat(map.get("currentPage"), equalTo(9));
}
@Test
public void testSetupModelPageOuter() {
when(page.getTotalPages()).thenReturn(5);
NotificationUtils.prepareNotifications(model, page, 2);
Map<String, Object> map = model.asMap();
replacedertThat(map.get("minPage"), equalTo(1));
replacedertThat(map.get("maxPage"), equalTo(5));
replacedertThat(map.get("currentPage"), equalTo(2));
}
@Test
public void testSetupModelPageOutBoundUpper() {
when(page.getTotalPages()).thenReturn(5);
NotificationUtils.prepareNotifications(model, page, 6);
Map<String, Object> map = model.asMap();
replacedertThat(map.get("minPage"), equalTo(1));
replacedertThat(map.get("maxPage"), equalTo(5));
replacedertThat(map.get("currentPage"), equalTo(5));
}
@Test
public void testSetupModelPageOutBoundLower() {
when(page.getTotalPages()).thenReturn(5);
NotificationUtils.prepareNotifications(model, page, 0);
Map<String, Object> map = model.asMap();
replacedertThat(map.get("minPage"), equalTo(1));
replacedertThat(map.get("maxPage"), equalTo(5));
replacedertThat(map.get("currentPage"), equalTo(1));
}
}
19
View Source File : GlobalControllerExceptionHandler.java
License : Apache License 2.0
Project Creator : zhcet-amu
License : Apache License 2.0
Project Creator : zhcet-amu
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(ItemNotFoundException.clreplaced)
public String handleNotFound(Model model, ItemNotFoundException infe) {
model.addAttribute("page_replacedle", getNotFoundreplacedle(infe));
model.addAttribute("type", infe.getType());
model.addAttribute("id", infe.getId());
return "not_found";
}
19
View Source File : DevelopmentController.java
License : Apache License 2.0
Project Creator : zhcet-amu
License : Apache License 2.0
Project Creator : zhcet-amu
@GetMapping
public String devDashboard(Model model) {
model.addAttribute("page_replacedle", "Development Dashboard");
model.addAttribute("page_subreplacedle", "Attendance Panel for Developers");
model.addAttribute("page_description", "View and manage services as a developer");
return "dev/dashboard";
}
19
View Source File : FloatCourseController.java
License : Apache License 2.0
Project Creator : zhcet-amu
License : Apache License 2.0
Project Creator : zhcet-amu
@GetMapping
public String floatCourse(Model model, @PathVariable Department department) {
ErrorUtils.requireNonNullDepartment(department);
model.addAttribute("page_replacedle", "Float Course : " + department.getName() + " Department");
model.addAttribute("page_subreplacedle", "Floated Course Management");
model.addAttribute("page_description", "Float and manage course and faculty in-charge for this session");
model.addAttribute("department", department);
model.addAttribute("page_path", getPath(department));
return "department/float_course";
}
19
View Source File : DepartmentController.java
License : Apache License 2.0
Project Creator : zhcet-amu
License : Apache License 2.0
Project Creator : zhcet-amu
@GetMapping("/{department}")
public String departmentPage(Model model, @PathVariable Department department) {
ErrorUtils.requireNonNullDepartment(department);
model.addAttribute("page_description", "Manage and float courses for the session");
model.addAttribute("department", department);
model.addAttribute("page_subreplacedle", "Course management for Department");
model.addAttribute("page_replacedle", department.getName() + " Department Panel");
model.addAttribute("page_path", getPath(department));
return "department/admin";
}
19
View Source File : UiController.java
License : Apache License 2.0
Project Creator : zhcet-amu
License : Apache License 2.0
Project Creator : zhcet-amu
@GetMapping
public String get(Model model) {
model.addAttribute("page_replacedle", "UI Management Panel");
model.addAttribute("page_subreplacedle", "Dynamic UI management");
return "dean/ui";
}
19
View Source File : FloatCoursesController.java
License : Apache License 2.0
Project Creator : zhcet-amu
License : Apache License 2.0
Project Creator : zhcet-amu
@GetMapping
public String floatCourse(Model model) {
model.addAttribute("page_replacedle", "Float Courses");
model.addAttribute("page_subreplacedle", "Float courses using CSV");
model.addAttribute("page_description", "Upload courses CSV to float courses in current session");
return "dean/float_course";
}
19
View Source File : NotificationUtils.java
License : Apache License 2.0
Project Creator : zhcet-amu
License : Apache License 2.0
Project Creator : zhcet-amu
public static void prepareNotifications(Model model, Page<?> page, int currentPage) {
int totalPages = page.getTotalPages();
int minPage = getSafePage(currentPage - 5, totalPages);
int maxPage = getSafePage(currentPage + 5, totalPages);
model.addAttribute("minPage", minPage);
model.addAttribute("maxPage", maxPage);
model.addAttribute("currentPage", getSafePage(currentPage, totalPages));
}
19
View Source File : EmailVerificationController.java
License : Apache License 2.0
Project Creator : zhcet-amu
License : Apache License 2.0
Project Creator : zhcet-amu
@GetMapping("/login/email/verify")
public String verifyEmail(Model model, @RequestParam("auth") String token) {
try {
emailVerificationService.verifyEmail(token);
model.addAttribute("success", "Your email was successfully verified!");
} catch (DuplicateEmailException | TokenVerificationException de) {
log.warn("Email Verification Error {}", de.getMessage());
model.addAttribute("error", de.getMessage());
}
return "user/verify_email";
}
19
View Source File : SystemController.java
License : MIT License
Project Creator : zhaojun1998
License : MIT License
Project Creator : zhaojun1998
@OperationLog("查看系统信息")
@GetMapping("/system/index")
public String index(Model model) throws Exception {
Server server = new Server();
server.copyTo();
model.addAttribute("server", server);
return "system/index";
}
See More Examples