Tagged Questions
0
votes
3answers
32 views
ServiceLayer Exception not been catched on controller
Testing my application I decided to shutdown the database.
public Object getEntityById(Class<?> clazz, Object _id) throws PersistenceServiceException {
Object o = null;
try {
o ...
2
votes
2answers
31 views
ExceptionHandler with ResponseBody: set ResponseStatus in method body
I have a method to handle a particular class of exceptions in a Spring MVC environment.
The metod (simplified) implementation follows
@ExceptionHandler(AjaxException.class)
...
0
votes
1answer
18 views
@ExceptionHandler with parameters not working
I am trying to capture all exceptions of some class in my Controller class. It works fine when
I define it like this:
@ExceptionHandler(NoSearchResultException.class)
public String ...
0
votes
0answers
37 views
Is relying on custom exception types for flow control considered good practice?
I would like to know whether relying on custom exception types for flow control is considered good practice.
Let's take an example:
public void activateEmail(String token) {
Member member = ...
1
vote
1answer
25 views
How to Handle Redirect Flow in Spring Controller
I am new to Spring and need a little guidance. I have through the Spring tutorials, but cannot find what I am looking for. I want to know what is the best way to handle this scenario:
User goes to ...
1
vote
0answers
64 views
Spring 3.2 @ControllerAdvice Not Working
I am having trouble getting @ControllerAdvice to work. I updated my namespace location, which were 3.1 in my xml files. I moved the class with the controller to the same package as the controller. ...
1
vote
2answers
84 views
@ExceptionHandler not firing
This has been asked a few times in Google-land, but I can't seem to apply those resolutions to my situation. My J2EE application uses Spring and I was previously using SimpleMappingExceptionResolver ...
0
votes
3answers
88 views
In Spring MVC, where to catch Database exceptions
I am following the structure suggested above at ( http://viralpatel.net/blogs/spring3-mvc-hibernate-maven-tutorial-eclipse-example/ ). I tried adding a duplicate entry, which resulted in the ...
0
votes
1answer
49 views
exception handling for filter in spring
I am handling exceptions in spring using @ExceptionHandler. Any exception thrown by controller is caught using method annotated with @ExceptionHandler and action is taken accordingly. To avoid writing ...
2
votes
2answers
252 views
Java Throwing exceptions vs returning response in catch
I know a lot has been discussed around exception handling, however I need some advice specific to my situation.
I am currently working on a Spring MVC application with ...
0
votes
1answer
309 views
Spring MVC session attribute is lost after uploading a large file
One of the functionalities of my Spring MVC application is uploading large files (about 500MB) which should be processed later.
The controller is:
@RequestMapping("/folderManagement/")
...
0
votes
1answer
49 views
Java spring exception handling when the compiler says it needs to wrapped in a try catch
Im using Spring to handle my exceptions in the controller class with @ExceptionHandler
I have a transport class (similar to a DAO) with the following
HttpResponse httpResponse = ...
2
votes
1answer
335 views
Propagating AccessDeniedException in Spring Security
In my web application I am using Spring Security and Spring MVC.
I have secured a couple of methods with @Secured annotation and configured Spring Security in such a way that when one of those methods ...
0
votes
2answers
314 views
handling wrapped exceptions in spring mvc
I have spring mvc and jackson. When I get incorrect request, jackson mapping fails and UnrecognizedPropertyException is thrown. i want to handle this exception using
@ExceptionHandler
public String ...
0
votes
1answer
64 views
How to handle generic Exception in spring
I am working on a spring project which has several classes. Now the code in that project is not up to the standard because of which there are no try catch blocks defined in any of the classes.
I have ...