WIP
[demos/httpresources] / src / main / java / de / juplo / demo / httpresources / DefaceController.java
1 package de.juplo.demo.httpresources;
2
3 import org.springframework.stereotype.Controller;
4 import org.springframework.ui.Model;
5 import org.springframework.web.bind.annotation.PathVariable;
6 import org.springframework.web.bind.annotation.RequestMapping;
7 import org.springframework.web.bind.annotation.RequestParam;
8
9
10 @Controller
11 public class DefaceController
12 {
13   @RequestMapping("/{path}.html")
14   public String controller(
15       @PathVariable String path,
16       @RequestParam(required = false) String origin,
17       Model model)
18   {
19     if (origin == null)
20       return "redirect:/help.html";
21
22     model.addAttribute("template", origin);
23     return path;
24   }
25 }