title: Spring Framework Default Error Page to JSON
body: <p>Sorry, 
  if i am asking for lazy solution.</p>
  
  <pre><code>  @SpringBootConfiguration
    public class RestWebApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(RestWebApplication.class, args);
      }
    }
  </code></pre>
  
  <p>But when nothing is implemented, I expected</p>
  
  <pre><code>$ curl localhost:8080
  {"timestamp":1384788106983,"error":"Not Found","status":404,"message":""}
  </code></pre>
  
  <p>But Got</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;title&gt;Apache Tomcat/8.5.9 - Error report&lt;/title&gt;&lt;style type="text/css"&gt;h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}&lt;/style&gt; &lt;/head&gt;&lt;body&gt;&lt;h1&gt;HTTP Status 404 - /&lt;/h1&gt;&lt;div class="line"&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;type&lt;/b&gt; Status report&lt;/p&gt;&lt;p&gt;&lt;b&gt;message&lt;/b&gt; &lt;u&gt;/&lt;/u&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;description&lt;/b&gt; &lt;u&gt;The requested resource is not available.&lt;/u&gt;&lt;/p&gt;&lt;hr class="line"&gt;&lt;h3&gt;Apache Tomcat/8.5.9&lt;/h3&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Did i miss something ? 
  So that i the error page is redirected as JSON Output?</p>
  
  <p>Thanks in credit for your help.</p>