本文整理汇总了Java中sample.web.ui.Message类的典型用法代码示例。如果您正苦于以下问题:Java Message类的具体用法?Java Message怎么用?Java Message使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Message类属于sample.web.ui包,在下文中一共展示了Message类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import sample.web.ui.Message; //导入依赖的package包/类
@PostMapping
public ModelAndView create(@Valid Message message, BindingResult result,
RedirectAttributes redirect) {
if (result.hasErrors()) {
return new ModelAndView("messages/form", "formErrors", result.getAllErrors());
}
message = this.messageRepository.save(message);
redirect.addFlashAttribute("globalMessage", "Successfully created a new message");
return new ModelAndView("redirect:/{message.id}", "message.id", message.getId());
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:MessageController.java
示例2: create
import sample.web.ui.Message; //导入依赖的package包/类
@RequestMapping(method = RequestMethod.POST)
public ModelAndView create(@Valid Message message, BindingResult result,
RedirectAttributes redirect) {
if (result.hasErrors()) {
return new ModelAndView("messages/form", "formErrors", result.getAllErrors());
}
message = this.messageRepository.save(message);
redirect.addFlashAttribute("globalMessage", "Successfully created a new message");
return new ModelAndView("redirect:/{message.id}", "message.id", message.getId());
}
示例3: list
import sample.web.ui.Message; //导入依赖的package包/类
@GetMapping
public ModelAndView list() {
Iterable<Message> messages = this.messageRepository.findAll();
return new ModelAndView("messages/list", "messages", messages);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:MessageController.java
示例4: view
import sample.web.ui.Message; //导入依赖的package包/类
@GetMapping("{id}")
public ModelAndView view(@PathVariable("id") Message message) {
return new ModelAndView("messages/view", "message", message);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:MessageController.java
示例5: createForm
import sample.web.ui.Message; //导入依赖的package包/类
@GetMapping(params = "form")
public String createForm(@ModelAttribute Message message) {
return "messages/form";
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:MessageController.java
示例6: delete
import sample.web.ui.Message; //导入依赖的package包/类
@GetMapping(value = "delete/{id}")
public ModelAndView delete(@PathVariable("id") Long id) {
this.messageRepository.deleteMessage(id);
Iterable<Message> messages = this.messageRepository.findAll();
return new ModelAndView("messages/list", "messages", messages);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:7,代码来源:MessageController.java
示例7: modifyForm
import sample.web.ui.Message; //导入依赖的package包/类
@GetMapping(value = "modify/{id}")
public ModelAndView modifyForm(@PathVariable("id") Message message) {
return new ModelAndView("messages/form", "message", message);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:MessageController.java
示例8: list
import sample.web.ui.Message; //导入依赖的package包/类
@RequestMapping
public ModelAndView list() {
Iterable<Message> messages = this.messageRepository.findAll();
return new ModelAndView("messages/list", "messages", messages);
}
示例9: view
import sample.web.ui.Message; //导入依赖的package包/类
@RequestMapping("{id}")
public ModelAndView view(@PathVariable("id") Message message) {
return new ModelAndView("messages/view", "message", message);
}
示例10: createForm
import sample.web.ui.Message; //导入依赖的package包/类
@RequestMapping(params = "form", method = RequestMethod.GET)
public String createForm(@ModelAttribute Message message) {
return "messages/form";
}