title: javax.servlet.ServletException: Could not resolve view with name 'contacts/show' in servlet with name 'dispatcher
body: <p>I am working with Spring MVC. I create two identity projects, with identity name, with <code>tiles</code>. One of them work ok, but other throw exception
  <code>javax.servlet.ServletException: Could not resolve view with name 'contacts/show' in servlet with name 'dispatcher</code>. How can i solve this issue?</p>
  
  <p><strong><em>UPD:</em></strong></p>
  
  <p>controller:</p>
  
  <pre><code>package ua.train.superproject.web;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.context.MessageSource;
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.validation.BindingResult;
  import org.springframework.web.bind.annotation.PathVariable;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.servlet.mvc.support.RedirectAttributes;
  import ua.train.superproject.model.Contact;
  import ua.train.superproject.service.ContactService;
  import ua.train.superproject.util.Message;
  import ua.train.superproject.util.UrlUtil;
  
  import javax.servlet.http.HttpServletRequest;
  import java.util.Locale;
  
  @Controller
  @RequestMapping(value = "/")
  public class ContactController {
  
      @Autowired
      ContactService contactService;
  
      @Autowired
      MessageSource messageSource;
  
      @RequestMapping(method = RequestMethod.GET)
      public String index(Model model) {
          return "redirect:/contacts";
      }
  
      @RequestMapping(value = "contacts", method = RequestMethod.GET)
      public String homePage(Model model) {
          model.addAttribute("contacts", contactService.findAllWithDetail());
          return "contacts/list";
      }
  
      @RequestMapping(value = "contacts/{id}", method = RequestMethod.GET)
      public String getById(@PathVariable("id") final Integer id, Model model) {
          model.addAttribute("contact", contactService.findById(id));
  //        model.addAttribute( contactService.findAllWithDetail()
  //                .stream().filter(a -&gt; a.getId().equals(id))
  //                .findFirst().orElse(null));
          return "contacts/show";
      }
  
      @RequestMapping(value = "contacts/{id}", params = "form", method = RequestMethod.POST)
      public String update(Contact contact, BindingResult bindingResult, Model model, HttpServletRequest httpServletRequest,
                           RedirectAttributes redirectAttributes, Locale locale) {
          if (bindingResult.hasErrors()){
              model.addAttribute("message", new Message("error",
                      messageSource.getMessage("contact_save_fail", new Object[]{}, locale)));
              model.addAttribute("contact", contact);
              return "contacts/update";
          }
          model.asMap().clear();
          redirectAttributes.addFlashAttribute("message", new Message("success",
                  messageSource.getMessage("contact_save_success", new Object[]{}, locale)));
          contactService.save(contact);
          return "redirect:/contacts/" + UrlUtil.encodeUrlPathSegment(contact.getId().toString(),
                  httpServletRequest);
      }
  
      @RequestMapping(value = "contacts/{id}", params = "form", method = RequestMethod.GET)
      public String updateForm(@PathVariable("id") Integer id, Model uiModel) {
          Contact contact = contactService.findById(id);
          /*.stream().filter(a -&gt; a.getId().equals(id))
                  .findFirst().orElse(null);*/
          uiModel.addAttribute("contact", contact);
  
          return "contacts/update";
      }
  
      @RequestMapping(value = "contacts", params = "form", method = RequestMethod.POST)
      public String create(Contact contact, BindingResult bindingResult, Model model, HttpServletRequest httpServletRequest,
                           RedirectAttributes redirectAttributes, Locale locale) {
          if (bindingResult.hasErrors()){
              model.addAttribute("message", new Message("error",
                      messageSource.getMessage("contact_save_fail", new Object[]{}, locale)));
              model.addAttribute("contact", contact);
              return "contacts/update";
          }
          model.asMap().clear();
          redirectAttributes.addFlashAttribute("message", new Message("success",
                  messageSource.getMessage("contact_save_success", new Object[]{}, locale)));
          contactService.save(contact);
          return "redirect:/contacts/" + UrlUtil.encodeUrlPathSegment(contact.getId().toString(),
                  httpServletRequest);
      }
  
      @RequestMapping(value = "contacts", params = "form", method = RequestMethod.GET)
      public String createForm(Model uiModel) {
          uiModel.addAttribute("contact", new Contact());
          return "contacts/create";
      }
  }
  </code></pre>
  
  <p>dispatcherServlet:</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:context="http://www.springframework.org/schema/context"
             xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
             xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
              http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
              http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"&gt;
  
          &lt;mvc:annotation-driven/&gt;
  
          &lt;context:component-scan base-package="ua.train.superproject.web"/&gt;
  
          &lt;mvc:resources mapping="/resources/**" location="/resources/"/&gt;
  
          &lt;mvc:default-servlet-handler/&gt;
  
          &lt;bean id="tilesConfigurer"
                class="org.springframework.web.servlet.view.tiles3.TilesConfigurer"&gt;
              &lt;property name="definitions"&gt;
                  &lt;list&gt;
                      &lt;value&gt;/WEB-INF/layouts/general.xml&lt;/value&gt;
                  &lt;/list&gt;
              &lt;/property&gt;
          &lt;/bean&gt;
  
          &lt;bean class="org.springframework.web.servlet.view.UrlBasedViewResolver"
                id="tilesViewResolver"&gt;
              &lt;property name="viewClass" value="org.springframework.web.servlet.view.tiles3.TilesView"/&gt;
          &lt;/bean&gt;
  
          &lt;mvc:interceptors&gt;
              &lt;bean class="org.springframework.web.servlet.theme.ThemeChangeInterceptor"
                    p:paramName="theme"/&gt;
              &lt;bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"
                    p:paramName="lang"/&gt;
          &lt;/mvc:interceptors&gt;
  
          &lt;bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
                id="messageSource" p:basenames="WEB-INF/i18n/messages,WEB-INF/i18n/application"
                p:fallbackToSystemLocale="false"/&gt;
  
          &lt;bean class="org.springframework.web.servlet.i18n.CookieLocaleResolver"
                id="localeResolver" p:cookieName="locale" p:defaultLocale="en_HK"/&gt;
  
          &lt;bean id="themeSource"
                class="org.springframework.ui.context.support.ResourceBundleThemeSource"&gt;
              &lt;property name="basenamePrefix" value="theme-"/&gt;
          &lt;/bean&gt;
  
          &lt;bean id="themeResolver"
                class="org.springframework.web.servlet.theme.CookieThemeResolver"&gt;
              &lt;property name="defaultThemeName" value="default"/&gt;
          &lt;/bean&gt;
      &lt;/beans&gt;
  
  web.xml
  
  &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_3_0.xsd"
      version="3.0"&gt;
      &lt;display-name&gt;java-blog-aggregator&lt;/display-name&gt;
  
  
      &lt;context-param&gt;
          &lt;param-name&gt;spring.profiles.default&lt;/param-name&gt;
          &lt;param-value&gt;jdbc,mysql&lt;/param-value&gt;
          &lt;!--&lt;param-value&gt;hibernate,mysql&lt;/param-value&gt;--&gt;
          &lt;!--&lt;param-value&gt;datajpa,mysql&lt;/param-value&gt;--&gt;
      &lt;/context-param&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/spring/root-context.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;dispatcher&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/dispatcher-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;dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&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;filter&gt;
          &lt;filter-name&gt;CharacterEncodingFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.CharacterEncodingFilter&lt;/filter-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;encoding&lt;/param-name&gt;
              &lt;param-value&gt;UTF-8&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;forceEncoding&lt;/param-name&gt;
              &lt;param-value&gt;true&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;CharacterEncodingFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>general.xml(tiles)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
  &lt;!DOCTYPE tiles-definitions PUBLIC
          "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
          "http://tiles.apache.org/dtds/tiles-config_3_0.dtd"&gt;
  &lt;tiles-definitions&gt;
      &lt;definition name="common" template="/WEB-INF/views/default.jspx"&gt;
          &lt;put-attribute name="footer" value="/WEB-INF/views/footer.jspx"/&gt;
          &lt;put-attribute name="header" value="/WEB-INF/views/header.jspx"/&gt;
          &lt;put-attribute name="menu" value="/WEB-INF/views/menu.jspx"/&gt;
      &lt;/definition&gt;
  
      &lt;definition name="contacts/list" extends="common"&gt;
          &lt;put-attribute name="body" value="/WEB-INF/views/contacts/list.jspx"/&gt;
      &lt;/definition&gt;
  
      &lt;definition name="contacts/show" extends="common"&gt;
          &lt;put-attribute name="body" value="/WEB-INF/views/contacts/show.jspx"/&gt;
      &lt;/definition&gt;
  
      &lt;definition name="contacts/update" extends="common"&gt;
          &lt;put-attribute name="body" value="/WEB-INF/views/contacts/edit.jsp"/&gt;
      &lt;/definition&gt;
  
      &lt;definition name="contacts/create" extends="common"&gt;
          &lt;put-attribute name="body" value="/WEB-INF/views/contacts/edit.jsp"/&gt;
      &lt;/definition&gt;
  
  &lt;/tiles-definitions&gt;
  </code></pre>
  
  <p>stacktrace:</p>
  
  <pre><code>javax.servlet.ServletException: Could not resolve view with name 'contacts/list' in servlet with name 'dispatcher'
      org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1262)
      org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1037)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
      org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
      org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thank you in advance!</p>