title: No WebApplicationContext found: no ContextLoaderListener registered :java.lang.IllegalStateException
body: <p>I am getting following error and i am not able to fix this problem.</p>
  
  <pre><code>java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
  org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:84)
  org.springframework.web.servlet.support.RequestContextUtils.getWebApplicationContext(RequestContextUtils.java:81)
  org.springframework.web.servlet.support.RequestContext.initContext(RequestContext.java:219)
  org.springframework.web.servlet.support.JspAwareRequestContext.initContext(JspAwareRequestContext.java:74)
  org.springframework.web.servlet.support.JspAwareRequestContext.&lt;init&gt;(JspAwareRequestContext.java:48)
  org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:76)
  org.apache.jsp.student_jsp._jspx_meth_form_005fform_005f0(student_jsp.java:128)
  org.apache.jsp.student_jsp._jspService(student_jsp.java:79)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  </code></pre>
  
  <p>1.WEB.XML</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;jlcindia&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/config/jlcindia-servlet.xml&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;jlcindia&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p></p>
  
  <p>2.jlcindia-servlet.xml</p>
  
  <p>
  
  
          
          
          
      </p>
  
  <pre><code>&lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
      &lt;property name="url" value="jdbc:mysql://localhost:3306/ankur" /&gt;
      &lt;property name="username" value="root" /&gt;
      &lt;property name="password" value="admin" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="sessionFactory"
      class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;property name="annotatedClasses"&gt;
          &lt;list&gt;
              &lt;value&gt;com.vivek.model.Student&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt;                
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="hibernateTransactionManager"
      class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p></p>
  
  <p>Controller Class:</p>
  
  <pre><code>@Controller
  public class StudentController {
  
  @Autowired
  private StudentService studentService;
  
  public String setupForm(Map &lt;String,Object&gt; map){
  
      System.out.println("setupForm() -&gt; StudentController Called");
  
      Student student=new Student();
      map.put("student",student);
      map.put("studentList",studentService.getAllstudent());
      return "student";
  
  }
  
  @RequestMapping(value="/student.do", method=RequestMethod.POST)
  public String doActions(@ModelAttribute Student student,BindingResult result,@RequestParam String actions,Map &lt;String,Object&gt; map){
  
      System.out.println("doActions() -&gt; StudentController Called");
  
      Student studentresult=new Student();
      switch (actions.toLowerCase()) {
      case "add":
          studentService.add(student);
          studentresult=student;
  
      case "edit":
          studentService.edit(student);
          studentresult=student;
  
      case "delete":
          studentService.delete(student.getStudentId());
          studentresult=new Student();
      case "search":
  
          Student searchStudent=studentService.getStudent(student.getStudentId());
          studentresult = searchStudent!=null ? searchStudent : new Student();
          break;
      default:
          break;
      }
  
      map.put("student",studentresult);
      map.put("student",studentService.getAllstudent());
  
      return "student";
          }
  }
  </code></pre>