title: org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver resolveException
body: <p>I am new to java mvc,I am getting same error</p>
  <blockquote>
  <p>Jan 27, 2020 10:48:16 PM org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver resolveException WARNING: Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json' not supported]</p>
  </blockquote>
  <p>I am attaching my folder structure and code. can you please help me to proceed further<br />
  <a href="https://i.stack.imgur.com/73vfv.png" rel="nofollow noreferrer">Folder structure</a></p>
  <pre><code>package com.controller;
  
  import javax.servlet.http.HttpServletRequest;
  
  import org.springframework.http.MediaType;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestBody;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  
  import com.bean.RegistrationBean;
  
  @Controller
  @RequestMapping(&quot;/helloworld&quot;)
  public class InitController {
  
      @RequestMapping(value=&quot;/register.do&quot;,method = RequestMethod.POST)
      public String hello(@RequestBody RegistrationBean register,HttpServletRequest request) {
          
          System.out.println(&quot;controller test&quot;);
          return &quot;asd&quot;;
      }
  
  }
  </code></pre>
  <p>web.xml</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;web-app version=&quot;3.1&quot; xmlns=&quot;http://xmlns.jcp.org/xml/ns/javaee&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd&quot;&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
          &lt;servlet-class&gt;
              org.springframework.web.servlet.DispatcherServlet
          &lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  <p>registration</p>
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
      $.fn.serializeObject = function()
      {
         var o = {};
         var a = this.serializeArray();
         $.each(a, function() {
             if (o[this.name]) {
                 if (!o[this.name].push) {
                     o[this.name] = [o[this.name]];
                 }
                 o[this.name].push(this.value || '');
             } else {
                 o[this.name] = this.value || '';
             }
         });
         return o;
      };
      
      $('#submit').click(function() {
          debugger
          var data = $(&quot;#registration&quot;).serializeObject();
          var dataToPort = JSON.stringify(data);
          $.ajax({
              type : 'POST',
              contentType: &quot;application/json&quot;,
              url : '../helloworld/register.do',
              dataType : &quot;json&quot;,
              data : dataToPort,
              cache : false,
              success : function(result) {
                  debugger
              }
          });
      });
  });
  </code></pre>
  
  <p>mvc-dispatcher-servlet</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot; xmlns:context=&quot;http://www.springframework.org/schema/context&quot; xmlns:mvc=&quot;http://www.springframework.org/schema/mvc&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot; http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context 
       http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd&quot;&gt;
      &lt;context:component-scan base-package=&quot;com.controller&quot;/&gt;
      &lt;mvc:annotation-driven/&gt;
      &lt;bean class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;
          &lt;property name=&quot;prefix&quot;&gt;
              &lt;value&gt;/WEB-INF/&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name=&quot;suffix&quot;&gt;
              &lt;value&gt;.jsp&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>