Contact Application Webapp

David Winterfeldt

2012


The web application builds on all the other modules, so has very little configuration of it's own. It has a JSP UI, Sencha ExtJS, and also a Sencha Touch UI. The latter Sencha UIs both use the REST services.

1. Web Configuration

Two servlets are configured. The first one configures a JSP application and the second one is for the REST API.

Excerpt from /WEB-INF/web.xml

                
<servlet>
    <servlet-name>simple-form</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/mvc/jsp-servlet-context.xml</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
</servlet>

<servlet>
    <servlet-name>spring-mvc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/mvc/rest-servlet-context.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
</servlet>

<servlet-mapping>
    <servlet-name>simple-form</servlet-name>
    <url-pattern>*.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>spring-mvc</servlet-name>
    <url-pattern>/api/*</url-pattern>
</servlet-mapping>