Spring Framework

MVC

Store a string from the form data in our model and pass it over to our view template as an uppercase string:

@RequestMapping("helloWorld")
public String helloWorld(HttpServletRequest request, Model model){
    String word = request.getParameter("name");
      String word = word.toUppercase();
      model.addAttribute("word", word);
      return "hello-world";
}
 
 

Diskussion