title: Home page RequestMapping. Spring MVC
body: <p>I try to get all avaliable groups from db when i load start page. Btu I can't set correct RequestMapping for home page and when i load home page it does load any data to JSP page. I try to set it as</p>
  
  <pre><code>@RequestMapping(value = "/", method = RequestMethod.GET)
  public ModelAndView newStudentForm() {
  
      ModelAndView mav = new ModelAndView(""); 
  
      mav.getModelMap().put("allGroups", gss.selectAllGroups()); // add all available groups
  
      return mav;
  }
  </code></pre>
  
  <p>but i'm not sure that i set correct 'value = "/"' and name in ModelAndView mav = new ModelAndView(""); </p>
  
  <p>Here's my xml file with all settings:</p>
  
  <pre><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" 
       xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                           http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
       id="WebApp_ID"
       version="3.0"&gt;
  
    &lt;display-name&gt;IRSystem&lt;/display-name&gt;
  
    &lt;!-- The start page --&gt;
    &lt;welcome-file-list&gt;
  &lt;welcome-file&gt;/WEB-INF/jsp/index.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;IRSystemServlet&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/IRSystemServlet-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;IRSystemServlet&lt;/servlet-name&gt;
         &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
     &lt;/servlet-mapping&gt;
  
   &lt;/web-app&gt;
  </code></pre>
  
  <p>IRSystemServlet-servlet.xml</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"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:mvc="http://www.springframework.org/schema/mvc"
  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/mvc
                      http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
  
                      http://www.springframework.org/schema/context
                      http://www.springframework.org/schema/context/spring-context-3.0.xsd
  
                      http://www.springframework.org/schema/tx
                      http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"&gt;
  
  &lt;!-- Set packages to scan for necessary components--&gt;
  &lt;context:component-scan base-package="org.irs.controllers"/&gt;
  &lt;context:component-scan base-package="org.irs.service"/&gt;
  &lt;context:component-scan base-package="org.irs.dao"/&gt;
  &lt;context:component-scan base-package="org.irs.entitis"/&gt;
  
  &lt;bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="viewClass"
          value="org.springframework.web.servlet.view.JstlView" /&gt;
      &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
      &lt;property name="suffix" value=".jsp" /&gt;
  &lt;/bean&gt;
  
  &lt;!-- JDBC DataSource --&gt;
  &lt;bean id="dataSource"
        class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close"&gt;
  
      &lt;property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/&gt;
      &lt;property name="url" value="jdbc:oracle:thin:VLAD-PC/@localhost:1521:orcl"/&gt;
      &lt;property name="username" value="VLAD"/&gt;
      &lt;property name="password" value="admin"/&gt;
  &lt;/bean&gt;
  
  &lt;!-- Hibernate session --&gt;
  &lt;bean id="sessionFactory"
        class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource"/&gt;
      &lt;property name="hibernateProperties"&gt;
          &lt;value&gt;hibernate.dialect=org.hibernate.dialect.OracleDialect&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="packagesToScan" value="org.irs.entities"/&gt;
  &lt;/bean&gt;
  
  &lt;tx:annotation-driven transaction-manager="transactionManager"/&gt;
  
  &lt;!-- set response encoding UTF-8 --&gt;
  &lt;bean class = "org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"&gt;
      &lt;property name="messageConverters"&gt;
          &lt;array&gt;
              &lt;bean class = "org.springframework.http.converter.StringHttpMessageConverter"&gt;
                  &lt;property name="supportedMediaTypes" value = "text/plain;charset=UTF-8" /&gt;
              &lt;/bean&gt;
          &lt;/array&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;mvc:annotation-driven/&gt;
  
  &lt;!-- Hibernate transaction --&gt;
  &lt;bean id="transactionManager"
      class="org.springframework.orm.hibernate4.HibernateTransactionManager"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p></p>
  
  <p>How should i do it to get all data i need to JSP page when i Load it?</p>