package com.darwinsys.springbootdemo;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller()
public class NotAServlet {

	@RequestMapping("/notaservlet")
	protected String doWork(@RequestParam(value="name") String name, Model model) {
		model.addAttribute("greets", String.format("<html><h1>Hello %s!!</h1>", name));
		return "hello";
	}
}

package com.darwinsys.springbootdemo;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller()
public class NotAServlet {

	@RequestMapping(value="/notaservlet", method=RequestMethod.GET)
	public String doWork(@RequestParam("name") String name, ModelMap model) {
		System.out.println("NotAServlet.doWork()");
		model.addAttribute("greetings", String.format("<html><h1>Hello %s!!</h1>", name));
		return "hello";
	}
}

Clean up; use ModelMap not Model; only GET method.
Clean up; use ModelMap not Model; only GET method.
