| 123456789101112131415161718192021222324252627 |
- package pl.dmcs.mati.controller;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.RequestMapping;
- import java.text.DateFormat;
- import java.util.Date;
- import java.util.Locale;
- @Controller
- public class HelloController {
- @RequestMapping(value = "/")
- public String helloWorld(Locale locale, Model model) {
- Date date = new Date();
- DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
- String formattedDate = dateFormat.format(date);
- model.addAttribute("serverTime", formattedDate );
- model.addAttribute("message","Polish characters encoding: ółźżćśńąęÓŁŹŻĆŚŃĄĘ");
- return "hello";
- }
- }
|