aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src/main/java/com/juick/www/controllers
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-11-23 16:19:26 +0700
committerGravatar Vitaly Takmazov2016-11-23 13:03:09 +0300
commite7fd58f1023ce9e1c9ab880bf27c5c0b2a3cffca (patch)
tree5ce36019dffc5f6eb4f71756a9f91068d5efbd54 /juick-spring-www/src/main/java/com/juick/www/controllers
parent37a171892ba11c578ea947103ee7488801785eac (diff)
thymeleaf layout plugin used
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.java16
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java4
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);