title: Liferay 7 Module Project Spring MVC Portlet, No handler found error as there is no viewrendererservlet
body: <p>I was developing a simple spring mvc portlet using the blade CLI. I am getting the error as   </p>
  
  <blockquote>
    <p>ERROR [http-nio-8080-exec-9][render_portlet_jsp:131] null
    org.springframework.web.portlet.NoHandlerFoundException: No handler
    found for portlet request: mode 'view', phase 'RENDER_PHASE',
    parameters map[[empty]]</p>
  </blockquote>
  
  <p>I dont know how to resolve the issue. I also checked the following link but I am not sure how to fix it. 
  <a href="https://issues.liferay.com/browse/LPS-63801?_ga=1.195671916.133904790.1461624186" rel="nofollow">https://issues.liferay.com/browse/LPS-63801?_ga=1.195671916.133904790.1461624186</a>
       Any help would be Appreciated. Thanks.</p>
  
  <p>Please find the code below.</p>
  
  <p>1.SpringController.java</p>
  
  <pre><code>package com.liferay.docs.mvcportlet.portlet.portlet;
  import com.liferay.portal.kernel.exception.PortalException;
  import com.liferay.portal.kernel.exception.SystemException;
  import org.springframework.context.annotation.Scope;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.ResponseBody;
  import org.springframework.web.portlet.ModelAndView;
  import org.springframework.web.portlet.bind.annotation.RenderMapping;
  import org.springframework.web.portlet.bind.annotation.ResourceMapping;
  import javax.portlet.RenderRequest;
  import javax.portlet.RenderResponse;
  import javax.portlet.ResourceRequest;
  import java.io.IOException;
  import java.util.Locale;
  @Controller
  @RequestMapping("VIEW")
  @Scope("prototype")
  public class SpringController {
  
  @RenderMapping
  public ModelAndView preAssess(RenderRequest renderRequest,
          RenderResponse renderResponse) {
      ModelAndView mv = new ModelAndView();
      mv.setViewName("view");
      return mv;
  }
  }
  </code></pre>
  
  <ol start="2">
  <li><p>MyMVCPortlet.java</p>
  
  <pre><code>package com.liferay.docs.mvcportlet.portlet.portlet;
  
  import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;
  
  import javax.portlet.Portlet;
  import javax.portlet.PortletConfig;
  import javax.portlet.PortletException;
  
  import org.osgi.framework.BundleActivator;
  import org.osgi.framework.BundleContext;
  import org.osgi.service.component.annotations.Component;
  import org.springframework.web.portlet.DispatcherPortlet;
  
  @Component(
  immediate = true,
  property = {
      "com.liferay.portlet.display-category=category.sample",
      "com.liferay.portlet.instanceable=false",
      "javax.portlet.display-name=my-mvc-portlet-project Portlet",
      "javax.portlet.init-param.view-template=/view.jsp",
      "javax.portlet.init-param.contextConfigLocation=/META-INF/spring-portlet.xml",
      "javax.portlet.resource-bundle=content.Language",
      "javax.portlet.security-role-ref=power-user,user",
  },
  service = Portlet.class
  )
   public class MyMvcPortlet extends DispatcherPortlet  {
  
  @Override
      public void init(PortletConfig config) throws PortletException {
          super.init(config);
      }
  
  
  }   
  </code></pre></li>
  <li><p>spring-portlet.xml</p>
  
  <pre><code>  &lt;?xml version="1.0"?&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:tx="http://www.springframework.org/schema/tx"   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.2.xsd
          http://www.springframework.org/schema/tx 
          http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context- 3.2.xsd"&gt;
   &lt;context:component-scan base- package="com.liferay.docs.mvcportlet.portlet.portlet" /&gt;
   &lt;bean id="viewResolver"
   class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
       &lt;property name="cache" value="true" /&gt;
       &lt;property name="viewClass"
      value="org.springframework.web.servlet.view.JstlView" /&gt;
       &lt;property name="prefix" value="/views/" /&gt;
       &lt;property name="suffix" value=".jsp" /&gt;
       &lt;/bean&gt;
       &lt;bean
   class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
        id="messageSource" p:fallbackToSystemLocale="true"&gt;
        &lt;property name="defaultEncoding" value="UTF-8" /&gt;
        &lt;!-- NOTE: cacheSeconds enable auto-reloading of properties. To turn off, 
           use "-1" --&gt;
       &lt;property name="cacheSeconds" value="-1" /&gt;
       &lt;property name="basenames"&gt;
           &lt;list&gt;
              &lt;value&gt;content.languages&lt;/value&gt;
           &lt;/list&gt;
         &lt;/property&gt;
     &lt;/bean&gt;
     &lt;bean id="localeChangeInterceptor"
             class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"&gt;
       &lt;property name="paramName" value="lang" /&gt;
     &lt;/bean&gt;
  
      &lt;bean id="localeResolver"
        class="org.springframework.web.servlet.i18n.CookieLocaleResolver"&gt;
        &lt;property name="defaultLocale" value="en" /&gt;
       &lt;/bean&gt;
  
       &lt;bean id="handlerMapping"
    class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMap ping"&gt;
          &lt;property name="interceptors"&gt;
         &lt;ref bean="localeChangeInterceptor" /&gt;
          &lt;/property&gt;
       &lt;/bean&gt;
      &lt;/beans&gt;
  </code></pre></li>
  <li><p>build.gradle</p>
  
  <pre><code>buildscript {
      dependencies {
          classpath group: "com.liferay", name: "com.liferay.gradle.plugins", version: "1.0.369"
      }
  
      repositories {
          mavenLocal()
  
          maven {
              url "https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public"
          }
      }
  }
  
  apply plugin: "com.liferay.plugin"
  
  def SPRING_VERSION = "4.3.2.RELEASE"
  
  
   dependencies {
      compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
      compile group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "2.0.0"
      compile group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.0.0"
      compile group: "javax.portlet", name: "portlet-api", version: "2.0"
      compile group: "javax.servlet", name: "servlet-api", version: "2.5"
      compile group: "jstl", name: "jstl", version: "1.2"
      compile group: "org.osgi", name: "org.osgi.compendium", version: "5.0.0"
      compile group: 'org.osgi', name: 'org.osgi.core', version: '5.0.0'
      // https://mvnrepository.com/artifact/org.springframework/spring-webmvc-portlet
      compile group: 'org.springframework', name: 'spring-webmvc-portlet', version: "$SPRING_VERSION"
      // https://mvnrepository.com/artifact/org.springframework/spring-webmvc
      compile group: 'org.springframework', name: 'spring-webmvc', version: "$SPRING_VERSION"
      // https://mvnrepository.com/artifact/org.springframework/spring-web
      compile group: 'org.springframework', name: 'spring-web', version: "$SPRING_VERSION"
      // https://mvnrepository.com/artifact/org.springframework/spring-core
      compile group: 'org.springframework', name: 'spring-core', version: "$SPRING_VERSION"
      // https://mvnrepository.com/artifact/org.springframework/spring-context
      compile group: 'org.springframework', name: 'spring-context', version: "$SPRING_VERSION"
      // https://mvnrepository.com/artifact/org.springframework/spring-beans
      compile group: 'org.springframework', name: 'spring-beans', version: "$SPRING_VERSION"
  }
  
  
  repositories {
      mavenLocal()
  
      maven {
          url "https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public"
      }
  }
  </code></pre></li>
  <li><p>/META-INF/views/view.jsp </p>
  
  <pre><code>&lt;%@ include file="/views/init.jsp" %&gt;
  
  &lt;p&gt;
      &lt;b&gt;&lt;liferay-ui:message key="springmvcportlet_SpringMVCPortletmvcportlet.caption"/&gt;&lt;/b&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>Any help would be Appreciated. Thanks.</p></li>
  </ol>