Permalink
Browse files

TopicListController: обработка UserNotFoundException

  • Loading branch information...
1 parent 51ee06f commit af0b380a081a9f996a5dfca45190847103f70421 @maxcom maxcom committed Apr 19, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/main/java/ru/org/linux/topic/TopicListController.java
@@ -19,11 +19,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.view.RedirectView;
@@ -886,5 +884,10 @@ private String calculateNavTitle(Section section, Group group, TopicListRequest
return navTitle.toString();
}
+ @ExceptionHandler(UserNotFoundException.class)
+ @ResponseStatus(HttpStatus.NOT_FOUND)
+ public ModelAndView handleUserNotFoundException() {
+ return new ModelAndView("errors/code404");
+ }
}

0 comments on commit af0b380

Please sign in to comment.