diff options
Diffstat (limited to 'juick-spring-www/src/main/java/com/juick/www/controllers')
-rw-r--r-- | juick-spring-www/src/main/java/com/juick/www/controllers/DivideByZeroController.java | 16 | ||||
-rw-r--r-- | juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java | 4 |
2 files changed, 2 insertions, 18 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/DivideByZeroController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/DivideByZeroController.java deleted file mode 100644 index 07266adc..00000000 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/DivideByZeroController.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.juick.www.controllers; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * Created by aalexeev on 11/21/16. - */ -@Controller -public class DivideByZeroController { - - @RequestMapping("/divideByZero") - public String getPage() { - return "divideByZero"; - } -} diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java index b8c25135..59ab52c2 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java @@ -55,10 +55,10 @@ public class ShowMessageController { if (isPostNumber && anything.equals(Integer.toString(messageId))) { if (messageId > 0) { com.juick.User author = messagesService.getMessageAuthor(messageId); + if (author != null) return "redirect:/" + author.getName() + "/" + anything; - } else if (messageId == 0) - return "forward:/divideByZero.html"; + } model.addAttribute("messageId", anything); |