Fix httpBase servlet request property.

This commit is contained in:
Paulo Gustavo Veiga 2013-02-03 12:38:04 -03:00
parent 73a664ab97
commit edc3351fd8

View File

@ -41,6 +41,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.util.Locale; import java.util.Locale;
@ -53,20 +54,16 @@ public class MindmapController {
@Autowired @Autowired
private MindmapService mindmapService; private MindmapService mindmapService;
@Value("${site.baseurl}")
String siteBaseUrl;
@RequestMapping(value = "maps/import") @RequestMapping(value = "maps/import")
public String showImportPage() { public String showImportPage() {
return "mindmapImport"; return "mindmapImport";
} }
@RequestMapping(value = "maps/{id}/details") @RequestMapping(value = "maps/{id}/details")
public String showDetails(@PathVariable int id, @NotNull Model model) { public String showDetails(@PathVariable int id, @NotNull Model model,@NotNull HttpServletRequest request) {
final MindMapBean mindmap = findMindmapBean(id); final MindMapBean mindmap = findMindmapBean(id);
model.addAttribute("mindmap", mindmap); model.addAttribute("mindmap", mindmap);
model.addAttribute("baseUrl", siteBaseUrl); model.addAttribute("baseUrl", request.getAttribute("site.baseurl"));
return "mindmapDetail"; return "mindmapDetail";
} }
@ -107,16 +104,16 @@ public class MindmapController {
} }
@RequestMapping(value = "maps/{id}/publish") @RequestMapping(value = "maps/{id}/publish")
public String showPublishPage(@PathVariable int id, @NotNull Model model) { public String showPublishPage(@PathVariable int id, @NotNull Model model,@NotNull HttpServletRequest request) {
final Mindmap mindmap = findMindmap(id); final Mindmap mindmap = findMindmap(id);
model.addAttribute("mindmap", mindmap); model.addAttribute("mindmap", mindmap);
model.addAttribute("baseUrl", siteBaseUrl); model.addAttribute("baseUrl", request.getAttribute("site.baseurl"));
return "mindmapPublish"; return "mindmapPublish";
} }
@RequestMapping(value = "maps/{id}/publishf") @RequestMapping(value = "maps/{id}/publishf")
public String showPublishPageFull(@PathVariable int id, @NotNull Model model) { public String showPublishPageFull(@PathVariable int id, @NotNull Model model,@NotNull HttpServletRequest request) {
showPublishPage(id, model); showPublishPage(id, model,request);
return "mindmapPublishFull"; return "mindmapPublishFull";
} }