title: Why can't I see my site, and get HTTP Status 404?
body: <p>I'm doing servlet using spring mvc and I can't see my site. I've posted my web.xml, mvc-dispatcher-servlet.xml and controller class below. Everything seems to be fine, but when I enter "localhost:8080" I get <code>404 http status
  The requested resource is not available</code>. Did I miss something?</p>
  
  <p>web.xml:</p>
  
  <pre><code>&lt;web-app version="2.4"
           xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
  
      &lt;display-name&gt;Weather&lt;/display-name&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;mvc-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;mvc-dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>mvc-dispatcher-servlet.xml:
  </p>
  
  <pre><code>&lt;context:component-scan base-package="com.springapp.mvc"/&gt;
  
  &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="prefix" value="/WEB-INF/pages/"/&gt;
      &lt;property name="suffix" value=".jsp"/&gt;
  &lt;/bean&gt;
  
  &lt;jpa:repositories base-package="com.springapp.mvc"/&gt;
  
  &lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"&gt;
      &lt;property name="persistenceUnitName" value="defaultPersistenceUnit"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
      &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;
  &lt;/bean&gt;
  
  &lt;tx:annotation-driven transaction-manager="transactionManager"/&gt;
  &lt;mvc:annotation-driven /&gt;
  </code></pre>
  
  <p>
  Controller class:</p>
  
  <pre><code>@Controller
  public class HomeController
  {
      Weather weather;
  
      @RequestMapping(value = "/", method = RequestMethod.GET)
      public String infoWeather(ModelMap model, HttpServletRequest req) {
  
          if (!model.containsAttribute("location") &amp;&amp; !model.containsAttribute("weather")) {
              Language.getInstance().setLanguage(LanguageManager.getLanguage(new Locale(System.getProperty("user.language"))));
              Location location = LocationManager.getLocation(req);
              model.addAttribute("location", location);
              weather = WeatherManager.getWeather(location);
              model.addAttribute("weather", weather);
          }
  
          if (!model.containsAttribute("destination"))
              model.addAttribute("destination", new Destination());
  
          return "index";
      }
  
      @RequestMapping(value = "/search", method = RequestMethod.POST)
      public String findDestination(@ModelAttribute("destination") Destination destination, BindingResult result, RedirectAttributes redirectAttrs) {
          destination = DestinationManager.getDestination(destination.getAddress());
          weather = WeatherManager.getWeather(destination);
          redirectAttrs.addFlashAttribute("weather", weather);
          return "redirect:/";
      }
  }
  </code></pre>