package ch.rasc.sec.controller;

import org.springframework.security.web.bind.annotation.AuthenticationPrincipal;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import ch.rasc.sec.security.JpaUserDetails;

@Controller
public class HelloController {

	@RequestMapping(value = "/", method = RequestMethod.GET)
	@ResponseBody
	public String sayHello(@AuthenticationPrincipal JpaUserDetails user) {
		return "Hello " + user.getUsername();
	}

}

@@ -26,16 +26,62 @@
 oller;%0A%0A
+import java.util.Date;%0Aimport java.util.Map;%0A%0A
 import o
@@ -153,16 +153,16 @@
 ncipal;%0A
-
 import o
@@ -506,16 +506,24 @@
 lue = %22/
+sayHello
 %22, metho
@@ -676,10 +676,299 @@
 ();%0A%09%7D%0A%0A
+%09@RequestMapping(%22/%22)%0A%09public String home(Map%3CString, Object%3E model,%0A%09%09%09@AuthenticationPrincipal JpaUserDetails user) %7B%0A%09%09model.put(%22message%22, %22Hello World%22);%0A%09%09model.put(%22title%22, %22Hello Home%22);%0A%09%09model.put(%22date%22, new Date());%0A%09%09model.put(%22user%22, user.getUsername());%0A%09%09return %22home%22;%0A%09%7D%0A
 %7D%0A

Add home request mapping method