Package com.controllers

Source Code of com.controllers.SimpleFormController

package com.controllers;
import com.form.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class SimpleFormController {
    
  @RequestMapping(value = "/simpleForm.html", method = RequestMethod.GET)
  public void simpleForm(Model model) {
       model.addAttribute(new User());
    }
  @RequestMapping(value = "/formoutput.html", method = RequestMethod.POST)
  public void simple(@ModelAttribute User user, Model model) {
       model.addAttribute("user", user);   
  }
}
TOP

Related Classes of com.controllers.SimpleFormController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.