title: IM getting "HTTP Status 500 - Servlet.init() for servlet dispatcher threw exception" error,new to spring-mvc and java
body: <p>I'm new to java ,self-learning through video's and stackoverflow , I cannot find where I committed error in this code.</p>
  <p>this is my web.xml :</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd&quot; id=&quot;WebApp_ID&quot; version=&quot;3.0&quot;&gt;
    &lt;display-name&gt;Spring-mvc&lt;/display-name&gt;
  
    &lt;servlet&gt;
    &lt;servlet-name&gt;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;dispatcher&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  <p>this is my dispatcher-servlet page:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;beans xmlns:mvc=&quot;http://www.springframework.org/schema/mvc&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xmlns=&quot;http://www.springframework.org/schema/beans&quot;
      xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
      xmlns:tx=&quot;http://www.springframework.org/schema/tx&quot;
      xsi:schemaLocation=&quot;http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd&quot;&gt;
          
          &lt;context:component-scan base-package=&quot;com.controller&quot;/&gt;    
          
      &lt;bean class=&quot;org.springframework.web.servlet.view.InternalResourceViewResoulver&quot;&gt;
      &lt;property name=&quot;prefix&quot; value=&quot;/WEB-INF/JSP/&quot;&gt;&lt;/property&gt;
     &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot; &gt;&lt;/property&gt;
       &lt;/bean&gt;    
         &lt;/beans&gt;
  </code></pre>
  <p>this is my controller java class:</p>
  <pre><code>package com.controller;
  
  import javax.servlet.http.HttpServletRequest;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestParam;
  import org.springframework.web.servlet.ModelAndView;
  
  @Controller
  @RequestMapping(&quot;/display&quot;)
  public class Control {
   
  //@RequestMapping(&quot;/display&quot;)
  public  ModelAndView reqandres(HttpServletRequest req) {
      
  String nme=req.getParameter(&quot;name&quot;);    
  
  
  
  
  return new ModelAndView(&quot;display&quot;,&quot;message&quot;,nme);
  }
  }
  </code></pre>
  <p>this is my login-page:index.jsp</p>
  <pre><code>&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=ISO-8859-1&quot;
      pageEncoding=&quot;ISO-8859-1&quot;%&gt;
  &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=ISO-8859-1&quot;&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action =&quot;display&quot; method=&quot;get&quot;&gt;&lt;br&gt;&lt;br&gt;
    &lt;input type=&quot;text&quot; name=&quot;Name&quot; placeholder=&quot;enter username&quot; &gt;&lt;br&gt;&lt;br&gt;
    &lt;input type= &quot;password&quot; name=&quot;passWord&quot; placeholder=&quot;enter password&quot;&gt;&lt;br&gt;&lt;br&gt;
    &lt;input   type=&quot;submit&quot; value=&quot;submit&quot;&gt;   
    &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>this is my view page (display.jsp):</p>
  <pre><code>&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=ISO-8859-1&quot;
      pageEncoding=&quot;ISO-8859-1&quot;%&gt;
  &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=ISO-8859-1&quot;&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action =&quot;display&quot; method=&quot;get&quot;&gt;&lt;br&gt;&lt;br&gt;
    &lt;input type=&quot;text&quot; name=&quot;Name&quot; placeholder=&quot;enter username&quot; &gt;&lt;br&gt;&lt;br&gt;
    &lt;input type= &quot;password&quot; name=&quot;passWord&quot; placeholder=&quot;enter password&quot;&gt;&lt;br&gt;&lt;br&gt;
    &lt;input   type=&quot;submit&quot; value=&quot;submit&quot;&gt;   
    &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>this is error I'm  getting:</p>
  <pre><code>HTTP Status 500 - Servlet.init() for servlet dispatcher threw exception
  
  
  type Exception report
  
  message Servlet.init() for servlet dispatcher threw exception
  
  description The server encountered an internal error that prevented it from fulfilling this request.
  
  exception
  javax.servlet.ServletException: Servlet.init() for servlet dispatcher threw exception
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
      java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.lang.Thread.run(Unknown Source)
  
  
  root cause
  org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.web.servlet.view.InternalResourceViewResoulver] for bean with name 'org.springframework.web.servlet.view.InternalResourceViewResoulver#0' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.web.servlet.view.InternalResourceViewResoulver
      org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1380)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:670)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:637)
      org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1489)
      org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1007)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:741)
      org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)
      org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
      org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:676)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:642)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:690)
      org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:558)
      org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:499)
      org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:172)
      javax.servlet.GenericServlet.init(GenericServlet.java:158)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
      java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.lang.Thread.run(Unknown Source)
  
  
  root cause
  java.lang.ClassNotFoundException: org.springframework.web.servlet.view.InternalResourceViewResoulver
      org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1332)
      org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1166)
      org.springframework.util.ClassUtils.forName(ClassUtils.java:255)
      org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:437)
      org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1428)
      org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1372)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:670)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:637)
      org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1489)
      org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1007)
      org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:741)
      org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)
      org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
      org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:676)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:642)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:690)
      org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:558)
      org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:499)
      org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:172)
      javax.servlet.GenericServlet.init(GenericServlet.java:158)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
      java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.lang.Thread.run(Unknown Source)
  
  
  note The full stack trace of the root cause is available in the Apache Tomcat/8.0.36 logs.
  
  
  Apache Tomcat/8.0.36
  </code></pre>
  <p>this is what I'm getting in console:</p>