Package com.jverstry.Controller

Source Code of com.jverstry.Controller.MyController

package com.jverstry.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class MyController {
 
  @RequestMapping(value = "/")
  public String home() {
    return "index";
  }
 
  @RequestMapping(value = "/retrieveUrlGetParameters")
  public ModelAndView retrUrlGetParameters(
        @RequestParam(value="firstName")
        String firstName,
        @RequestParam(value="lastName")
        String lastName
        ) {
       
        ModelAndView result = new ModelAndView("retrieveUrlGetParameters");
       
        System.out.println(firstName + " " + lastName);
       
        result.addObject("retrFirstName", firstName);
        result.addObject("retrLastName", lastName);
       
    return result;
       
  }
   
}
TOP

Related Classes of com.jverstry.Controller.MyController

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.