From 771c27021c033f5b6b9a3d9fdcd4048f9d8023af Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Mon, 21 Nov 2016 13:38:27 +0700 Subject: spring-www project skeleton --- .../com/juick/www/controllers/TagController.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java (limited to 'juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java') diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java new file mode 100644 index 00000000..5c3b6287 --- /dev/null +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java @@ -0,0 +1,37 @@ +package com.juick.www.controllers; + +import com.juick.service.MessagesService; +import com.juick.service.TagService; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.inject.Inject; + +/** + * Created by aalexeev on 11/21/16. + */ +@Controller +public class TagController { + @Inject + private TagService tagService; + @Inject + private MessagesService messagesService; + + + @RequestMapping("/tag/{tagName}") + public String showTags( + @PathVariable String tagName, + @RequestParam(required = false, defaultValue = "0") int before, + Model model) { + + return "index"; + } + + @RequestMapping("/tag") + public String redirectToMain() { + return "redirect:/"; + } +} -- cgit v1.2.3