Answer:
My Spring 3 Java webapp is "acme". I had this for my JQuery call to contact the Spring 3 Java server side components:
$.post("/test_ajax",  {state:"Alaska"});
I needed to put the "context-root" ( aka the webapp name ) in the URL:
$.post("/acme/test_ajax",  {state:"Alaska"});
I'm learning Spring 3, Ajax and JQuery. I made myself a small webapp, "acme", to learn how to connect the 3 technologies. From my logging statements it looks the handler method getAddressList() in the Controller HelloController is not getting called after the JQuery POST request.
I started off making my JQuery call as:
$.post("/test_ajax",  {state:"Alaska"});
My code is quoted below
Any clues would be much appreciated. Thanks in advance Steve
hello.jsp
<html>
<head>
    <title>ACME JSP</title>
    <script language = "JavaScript" src = "../acme/js/jquery-1.7.js"></script>
    <script language = "JavaScript">
    function test(){
        $("#div1").replaceWith("Text Replaced With Javascript");
        $.post("/test_ajax",  {state:"Alaska"});
    }  
    </script>
</head>
<body>
    <h1>Hello.jsp: ${message}</h1>  
    <div id = "div1">
        Original Text
    </div>
    <input type="submit" value="Test" onclick="test()" /> 
</body>
</html>
HelloController.java:
package com.acme.controller;
import javax.annotation.Resource;
import javax.servlet.http.*;
import org.springframework.stereotype.Controller;
import org.springframework.validation.*;
import org.springframework.ui.ModelMap;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.apache.log4j.Logger;
@Controller
public class HelloController {
    private static final Logger logger  = Logger.getLogger(HelloController.class);
   @RequestMapping({"/","/hello"})
    public String home(ModelMap model) {
        logger.debug("Started...");
        model.put("message","Hello From The Spring 3.1 Controller!");
        return "hello";
    }
    @RequestMapping(value = "/test_ajax", method = RequestMethod.POST)
    public @ResponseBody String getAddressList( @RequestParam(required=true) String state,
                                                ModelMap model  ) {
        logger.debug("started...");
        logger.debug("State: " + state);
        String a_string  = "Test String From Spring And Ajax!";
        return a_string;
    }
}// end class HelloController
acme-servlet.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:mvc="http://www.springframework.org/schema/mvc"
  xsi:schemaLocation="http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
        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">
  <context:component-scan base-package="com.acme.controller" />
  <mvc:resources mapping = "/**" location = "/"/>
  <mvc:annotation-driven/>
  <bean
    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name = "prefix" value = "/jsp/"/>
    <property name = "suffix" value = ".jsp"/>
  </bean>
</beans>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app  id="WebApp_ID" version="3.0"
   xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
  <display-name>ACME Web Application</display-name>
  <servlet>
    <servlet-name>acme</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>acme</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
  <!-- Help Find The Spring Config Files -->
  <listener>
    <listener-class>
                  org.springframework.web.context.ContextLoaderListener
    </listener-class>
  </listener>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/acme-servlet.xml</param-value>
  </context-param>
</web-app>
pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.acme</groupId>
    <artifactId>acme</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>ACME webapp</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>jstl-api</artifactId>
            <version>1.2-rev-1</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet.jsp</groupId>
                    <artifactId>jsp-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>jstl-impl</artifactId>
            <version>1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet.jsp</groupId>
                    <artifactId>jsp-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Spring 3.1.1 -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>3.1.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>3.1.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>3.1.1.RELEASE</version>
        </dependency>
        <!-- Spring Security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-ldap</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>
        <!-- Jackson JSON Mapper -->
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.6.4</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>acme</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
 
     
     
     
    