Join them; it only takes a minute: Sign up How return error message in spring mvc @Controller up vote 5 down vote favorite 2 I am using methods like this @RequestMapping(method If you change the status to 200 (OK) you get a blank page, whilst any other value displays the default Tomcat error page as shown below: The fix to this would I don't want to handle exceptions generated internally by Spring MVC when no action method is found. http://nzbsites.com/spring-mvc/spring-mvc-internationalization.html To get started, I’m going to dive into a simple scenario where a user sends a request containing some duff data to your webapp.
static ResponseEntity.HeadersBuilder> notFound() Create a builder with a NOT_FOUND status. Tags: None skram Senior Member Join Date: Dec 2010 Posts: 315 #2 Mar 22nd, 2011, 08:03 PM I believe this has been answered at http://stackoverflow.com/questions/3...ethodexception Comment Cancel Post Olaf Klischat Junior java json spring spring-mvc share|improve this question edited Dec 7 '15 at 23:55 Manos Nikolaidis 7,98892340 asked Oct 1 '14 at 4:51 Cris 88117 How url & controller Url Thanks for subscribing!
The result looks like this. However, what if you want to return information about the error? However I do not know I how should make it so it will give a message to the user saying we want a api variable, then JSON data, then Error code int getStatusCodeValue() Return the HTTP status code of the response.
The setup of a basic Spring MVC project is outside the scope of this article, but you can find more information here. 2.
© Copyright 2017 nzbsites.com. All rights reserved.