20 lines
626 B
Java
20 lines
626 B
Java
package org.gcube.app.springbootangulardemo.controller;
|
|
|
|
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 GreetingController {
|
|
|
|
//This return the templates/greeting.html
|
|
@RequestMapping("/greeting")
|
|
public String greeting(@RequestParam(name="name", required=false, defaultValue="World") final String name,
|
|
final Model model) {
|
|
|
|
//This return the greeting.html
|
|
model.addAttribute("name", name);
|
|
return "greeting";
|
|
}
|
|
} |