I am currently working on a simple application that gets a list of users from a MySQL database and returns the data as JSON format. I am using a Ext JS Store to make the ajax call.

Store:

```
Ext.define('MyApp.store.AdminUsers', {
    extend: 'MyApp.store.BaseStore'
    ,model: 'MyApp.model.AdminUser'
    ,remoteSort: true
    ,pageSize: 20   
    ,proxy: {
        type: 'ajax'
        ,url: contextPath + '/admin/users/list.htm'
        ,actionMethods: 'POST'
        ,simpleSortMode: true
        ,pageParam: undefined
        ,reader: {
            type: 'json'
            ,root: 'adminUsers'
            ,successProperty: 'success'
            ,totalProperty: 'totalCount'
        }
    }
});

```

Spring MVC Controller: 

```
@Controller
@RequestMapping("/admin/users/")
public class AdminUserController extends BaseController {
 // items removed for brevity
@RequestMapping(value = "/list")
@ResponseBody 
public Model listAllAdminUsers(Model model, HttpServletRequest request) throws Exception {
    FindInfo findInfo = getFindInfo(request);
    model.addAttribute("totalCount", adminUserService.getCount(findInfo));
    model.addAttribute("adminUsers",    AdminUserConverter.createListData(adminUserService.getList(findInfo)));
        return model;
    }
}

```

web.xml:

```
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>

<!-- Spring Security -->
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>

<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:springConfig/applicationContext.xml</param-value>
</context-param>

<!-- Spring MVC -->
<servlet>
    <servlet-name>mvc-dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:springConfig/mvc-dispatcher-servlet.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>mvc-dispatcher</servlet-name>
    <url-pattern>*.htm</url-pattern>
</servlet-mapping>

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<session-config>
    <session-timeout>20</session-timeout>
</session-config>

```

mvc-dispatcher-servlet.xml:

```
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans     
        http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-4.0.xsd">

    <import resource="spring-controller.xml" />
    <import resource="spring-view.xml" />
    <context:component-scan base-package="com.myapp.web.controller" />

    <mvc:resources mapping="/lib/**" location="/lib/" />
    <mvc:resources mapping="/extjs/**" location="/extjs/" />

    <mvc:annotation-driven />
</beans>

```

spring-controller.xml:

```
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
                        http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                        http://www.springframework.org/schema/context 
                        http://www.springframework.org/schema/context/spring-context-4.0.xsd">      

    <!-- Configuration to recognize annotation based controller -->
<!--     <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />  -->
    <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
        <property name="messageConverters">
            <list>
                <ref bean="jacksonMessageConverter" />
            </list>
        </property>
    </bean>

    <bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />

</beans>

```

spring-view.xml:

```
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-4.0.xsd" >

    <bean class="org.springframework.web.servlet.view.BeanNameViewResolver"></bean>

    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
        <property name="prefix" value="/WEB-INF/pages/" />
        <property name="suffix" value=".jsp" />
    </bean>

</beans>

```

I have the proper Jackson libraries on my class path, sometimes I am getting 406 error and have tried changing accept and content-type headers in Ext JS and defining `produces` type for the listAllAdminUsers method. When I get a 404 (I have tried several different things), spring is trying to resolve the controller method as view and is looking for admin/users/list.jsp (not sure why?). I have exhausted all of the options by searching numerous answers and I have tried everything it seems. Please help!!