Unable to run a simple "Hello World!" project using NetBeans IDE 8.1, Glassfish 4.1
<p>I am a beginner in Spring. Trying to run a simple "Hello World!" project using NetBeans IDE 8.1, Glassfish 4.1</p>

<p>Here is my code:</p>

<p>web.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;context-param&gt;
    &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
    &lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;
&lt;/context-param&gt;
&lt;listener&gt;
    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
&lt;/listener&gt;
&lt;servlet&gt;
    &lt;servlet-name&gt;tryspring&lt;/servlet-name&gt;
    &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
    &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;tryspring&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;session-config&gt;
    &lt;session-timeout&gt;
        30
    &lt;/session-timeout&gt;
&lt;/session-config&gt;
&lt;welcome-file-list&gt;
    &lt;welcome-file&gt;redirect.jsp&lt;/welcome-file&gt;
&lt;/welcome-file-list&gt;
</code></pre>

<p></p>

<p>servlet.xml</p>

<pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;

&lt;bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/&gt;

&lt;!--
Most controllers will use the ControllerClassNameHandlerMapping above, but
for the index controller we are using ParameterizableViewController, so we must
define an explicit mapping for it.
--&gt;
&lt;bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;
    &lt;property name="mappings"&gt;
        &lt;props&gt;
            &lt;prop key="index.jsp"&gt;indexController&lt;/prop&gt;
        &lt;/props&gt;
    &lt;/property&gt;
&lt;/bean&gt;

&lt;bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"
      p:prefix="/WEB-INF/jsp/"
      p:suffix=".jsp" /&gt;

&lt;!--
The index controller.
--&gt;
&lt;bean name="indexController"
      class="org.springframework.web.servlet.mvc.ParameterizableViewController"
      p:viewName="index" /&gt;
</code></pre>

<p></p>

<p>index.jsp</p>

<p>
    </p>

<pre><code>&lt;/head&gt;

&lt;body&gt;
    &lt;p&gt;Hello! This is the default welcome page for a Spring Web MVC project.&lt;/p&gt;
    &lt;p&gt;&lt;i&gt;To display a different welcome page for this project, modify&lt;/i&gt;
        &lt;tt&gt;index.jsp&lt;/tt&gt; &lt;i&gt;, or create your own welcome page then change
            the redirection in&lt;/i&gt; &lt;tt&gt;redirect.jsp&lt;/tt&gt; &lt;i&gt;to point to the new
            welcome page and also update the welcome-file setting in&lt;/i&gt;
        &lt;tt&gt;web.xml&lt;/tt&gt;.&lt;/p&gt;
&lt;/body&gt;
</code></pre>

<p></p>

<p>But when I am running the project no page is being displayed.</p>

<pre><code>Error: "HTTP Status 404 - Not Found"
</code></pre>

<p>Can any one please help on this?</p>

<p>Also this code is generated by NetBeans IDE.<br>
I have just modified the dispatcher modifier from <code>*.htm</code> to <code>*.jsp</code>. Is it causing the problem?</p>