title: Error In Maven Spring 3 Dynamic Application
body: <p>i am using <code>maven</code>, <code>spring 3</code> for <code>dynamic project</code>. I am getting error at <code>&lt;bean name="/hello.cs" class="com.maven.controller.HelloController"/&gt;</code> as <code>Multiple annotations found at this line:
      - Class 'com.maven.controller.HelloController'</code></p>
  
  <p><strong>Project Structure</strong></p>
  
  <p><a href="https://i.stack.imgur.com/bggD5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bggD5.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Web.xml</strong></p>
  
  <pre><code>&lt;!DOCTYPE web-app PUBLIC
   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
   "http://java.sun.com/dtd/web-app_2_3.dtd" &gt;
  
  &lt;web-app&gt;
    &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;hello&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/spring.xml&lt;/param-value&gt;
      &lt;/init-param&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;hello&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.cs&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>Spring.xml</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"&gt;
  
  
      &lt;bean name="/hello.cs" class="com.maven.controller.HelloController"/&gt;
  
  
      &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="prefix" value="/WEB-INF/jsp/"/&gt;
          &lt;property name="suffix" value=".jsp"/&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>index.jsp</strong></p>
  
  <pre><code>&lt;jsp:forward page="WEB-INF/jsp/home.jsp"&gt;&lt;/jsp:forward&gt;
  </code></pre>
  
  <p><strong>home.jsp</strong></p>
  
  <pre><code>&lt;form action="./hello.cs" method="post"&gt;
      &lt;div&gt;
          &lt;div&gt;
              User Name:&lt;input type="text" name="name"/&gt;
          &lt;/div&gt;
          &lt;div&gt;
              Password: &lt;input type="password" name="pass"/&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;input type="submit" value="Login"/&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;p style="color: red"&gt;${msg}&lt;/p&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>HelloController</strong></p>
  
  <pre><code>package com.maven.controller;
  
  import java.util.HashMap;
  import java.util.Map;
  
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import org.springframework.web.servlet.ModelAndView;
  import org.springframework.web.servlet.mvc.AbstractController;
  import org.springframework.web.servlet.mvc.Controller;
  
  public class HelloController extends AbstractController{
  
      public ModelAndView handleRequest(HttpServletRequest req, HttpServletResponse resp) throws Exception {
  
          String name = req.getParameter("name");
          String pwd = req.getParameter("pass");
  
          Map&lt;String, String&gt; m = new HashMap&lt;String, String&gt;();
  
          if(name.equalsIgnoreCase("xyz") &amp;&amp; pwd.equalsIgnoreCase("123")){
  
              m.put("msg", "welcome mr. "+req.getParameter("name"));
              return new ModelAndView("success", m);
          } else {
              m.put("msg", "Invalid");
              return new ModelAndView("home");
          }
      }
  }
  </code></pre>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;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"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.javatpoint&lt;/groupId&gt;
    &lt;artifactId&gt;CubeGeneratorWeb&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;CubeGeneratorWeb Maven Webapp&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8.1&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
          &lt;version&gt;3.0.0.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- https://mvnrepository.com/artifact/javax.servlet/servlet-api --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;2.5&lt;/version&gt;
      &lt;/dependency&gt;
  
  
    &lt;/dependencies&gt;
    &lt;build&gt;
      &lt;finalName&gt;CubeGeneratorWeb&lt;/finalName&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>Error:</strong>
  <a href="https://i.stack.imgur.com/wcTze.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wcTze.jpg" alt="enter image description here"></a></p>