title: @RequestParam annotation at class level not working as expected
body: <p>This is the controller:</p>
  
  <pre class="lang-java prettyprint-override"><code>        package com.spring.controller;
  
          import java.util.Arrays;
          import java.util.List;
  
          import javax.servlet.http.HttpSession;
  
          import org.jboss.logging.annotations.Param;
          import org.springframework.beans.factory.annotation.Autowired;
          import org.springframework.stereotype.Controller;
          import org.springframework.web.bind.annotation.ModelAttribute;
          import org.springframework.web.bind.annotation.RequestMapping;
          import org.springframework.web.bind.annotation.RequestMethod;
          import org.springframework.web.servlet.ModelAndView;
  
          import com.spring.DAO.CountryDAO;
          import com.spring.DAO.HospitalDAO;
          import com.spring.DAO.HospitalSpecialityDAO;
          import com.spring.DAO.SpecialityDAO;
          import com.spring.VO.HospitalSpecialityVO;
          import com.spring.VO.HospitalVO;
          import com.spring.VO.SpecialityVO;
  
          @Controller
          @RequestMapping("/admin")
          public class HospitalController {
  
              @Autowired
              CountryDAO country;
              @Autowired
              HospitalDAO hospital;
              @Autowired
              SpecialityDAO Speciality;
              @Autowired
              HospitalSpecialityDAO hospitalSpeciality;
  
      @RequestMapping("/addHospital.html")
      public ModelAndView addHospital(HttpSession session) throws Exception {
        List&lt;Object&gt; list = this.country.getCountry();
        session.setAttribute("list", list);
        List&lt;Object&gt; slist = this.Speciality.getSpeciality();
        session.setAttribute("slist", slist);
        return new ModelAndView("admin/addHospital",
              "insertHospitalSpeciality", new HospitalSpecialityVO());
  
      }
     }
  </code></pre>
  
  <p>And this is the URL which I want to map:</p>
  
  <pre class="lang-none prettyprint-override"><code>/projectname/admin/addHospital.html
  </code></pre>
  
  <p>This is the <code>web.xml</code> file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>            &lt;?xml version="1.0" encoding="UTF-8"?&gt;
              &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns="http://java.sun.com/xml/ns/javaee"
                  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
                  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                  version="2.5"&gt;
  
                  &lt;servlet&gt;
                      &lt;servlet-name&gt;spring&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;spring&lt;/servlet-name&gt;
                      &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
                  &lt;/servlet-mapping&gt;
  
              &lt;listener&gt;
              &lt;listener-class&gt;
              org.springframework.web.context.ContextLoaderListener
              &lt;/listener-class&gt;
              &lt;/listener&gt;
              &lt;context-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/spring-security.xml&lt;/param-value&gt;
              &lt;/context-param&gt;
              &lt;filter&gt;
              &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
              &lt;filter-class&gt;
              org.springframework.web.filter.DelegatingFilterProxy
              &lt;/filter-class&gt;
              &lt;/filter&gt;
              &lt;filter-mapping&gt;
              &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
              &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
              &lt;/filter-mapping&gt;
  
  
              &lt;/web-app&gt;
  </code></pre>
  
  <p><code>spring-servlet.xml</code> file:</p>
  
  <pre class="lang-xml prettyprint-override"><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"  
                  xmlns:p="http://www.springframework.org/schema/p"  
                  xmlns:context="http://www.springframework.org/schema/context"  
                  xsi:schemaLocation="http://www.springframework.org/schema/beans  
              http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
              http://www.springframework.org/schema/context  
              http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;  
  
                  &lt;context:component-scan  base-package="com.spring" /&gt; 
  
  
  
                  &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;  
                      &lt;property name="prefix" value="WEB-INF/view/" /&gt;  
                      &lt;property name="suffix" value=".jsp" /&gt;  
                  &lt;/bean&gt;  
                  &lt;bean id="multipartResolver"
                      class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt;
  
                       &lt;!-- setting maximum upload size --&gt;
                      &lt;property name="maxUploadSize" value="100000" /&gt;
  
                  &lt;/bean&gt;
                  &lt;!-- &lt;bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close"&gt;
                      &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
                      &lt;property name="url" value="jdbc:mysql://localhost/healthanalytics"/&gt;
                      &lt;property name="username" value="root"/&gt;
                      &lt;property name="password" value="root"/&gt;
                  &lt;/bean&gt; --&gt;
  
                  &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
                      &lt;property name="dataSource" ref="dataSource" /&gt;
  
                       &lt;property name="annotatedClasses"&gt;
                          &lt;list&gt;
                              &lt;value&gt;com.spring.VO.CityVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.ComplainVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.CountryVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.DiseaseVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.DoctorVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.FeedbackVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.HospitalVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.MedicineVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.PatientVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.StateVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.SpecialityVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.SymptomVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.HospitalSpecialityVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.DoctorSpecialityVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.DoctorHospitalVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.RegistrationVO&lt;/value&gt;
                              &lt;value&gt;com.spring.VO.LoginVO&lt;/value&gt;
  
  
  
  
                              &lt;!-- &lt;value&gt;com.malhar.model.Login&lt;/value&gt; --&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;prop key="hibernate.enable_lazy_load_load_trans"&gt;true&lt;/prop&gt;
                          &lt;/props&gt;
                      &lt;/property&gt;
                  &lt;/bean&gt;      
  
              &lt;/beans&gt;
  </code></pre>
  
  <p>But when I call the following url:</p>
  
  <pre class="lang-none prettyprint-override"><code>http://localhost:8080/health/admin/addHospital.html
  </code></pre>
  
  <p>I get: </p>
  
  <blockquote>
    <p>HTTP Status 404 - /health/admin/WEB-INF/view/admin/addHospital.jsp</p>
  </blockquote>
  
  <p>Here <code>health</code> is the project name.</p>
  
  <p>I am not able to figure out that while getting the result why it is trying to put <code>admin</code> before <code>WEB-INF</code> as shown in error.</p>
  
  <p>Why can't it just get result from <code>/health/WEB-INF/view/admin/addHospital.jsp</code>?</p>
  
  <p>Also if anyone can provide any alternate solution to this it would be much helpful.</p>