PromptController.java 826 B

1234567891011121314151617181920
  1. package com.bofeng.controller;
  2. import org.springframework.ui.ModelMap;
  3. import org.springframework.web.bind.annotation.GetMapping;
  4. import org.springframework.web.bind.annotation.RequestParam;
  5. import org.springframework.web.bind.annotation.RestController;
  6. import org.springframework.web.servlet.ModelAndView;
  7. @RestController
  8. public class PromptController {
  9. @GetMapping("/prompt/prompt.html")
  10. public ModelAndView prompt(@RequestParam(name = "title", required = false, defaultValue = "提示") String title,
  11. @RequestParam(name = "message", required = false, defaultValue = "提示") String message,
  12. ModelMap model){
  13. model.put("title",title);
  14. model.put("message",message);
  15. return new ModelAndView("/prompt/prompt.ftl",model);
  16. }
  17. }