Fórumok

org.springframework.web.portlet.NoHandlerFoundException: No matching handle

srinivasa rao, módosítva 10 év-val korábban

org.springframework.web.portlet.NoHandlerFoundException: No matching handle

Regular Member Bejegyzések: 189 Csatlakozás dátuma: 2014.01.29. Legújabb bejegyzések
Hi All,

At finally i created a error free Spring portlet in Liferay 6.2
after deploying into sever it showing one exception.

here i copied my sample controller java code and bean xml

package com.test.springmvc.controller;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.portlet.bind.annotation.RenderMapping;

@Controller(value = "MyFirstSpringMVCTestController")
@RequestMapping("VIEW")
public class MyFirstSpringMVCTestController {
@RenderMapping
public String handleRenderRequest(RenderRequest request,RenderResponse response,Model model) throws Exception{
return "defaultRender";
}

}
bean

<?xml version="1.0" encoding="UTF-8"?>
<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.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.InternalResourceView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<bean class="org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
<context:component-scan base-package="com.test.springmvc.controller"/>
</beans>

The exception is below:
org.springframework.web.portlet.NoHandlerFoundException: No matching handler method found for portlet request: mode 'view', phase 'ACTION_PHASE', parameters map[[empty]]

Regards,
Srinivas.
thumbnail
David H Nebinger, módosítva 10 év-val korábban

RE: org.springframework.web.portlet.NoHandlerFoundException: No matching ha

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
portlets must support the ACTION and RENDER phases at least.

I'm guessing, of course, that you are completely new at this and rather than using an existing, working example you're trying to do things on your own?
srinivasa rao, módosítva 10 év-val korábban

RE: org.springframework.web.portlet.NoHandlerFoundException: No matching ha

Regular Member Bejegyzések: 189 Csatlakozás dátuma: 2014.01.29. Legújabb bejegyzések
i took some working example
thumbnail
meera prince, módosítva 10 év-val korábban

RE: org.springframework.web.portlet.NoHandlerFoundException: No matching ha

Liferay Legend Bejegyzések: 1111 Csatlakozás dátuma: 2011.02.08. Legújabb bejegyzések
Hi

The following is configuration in portletName-portlet.xml as for your controller

<context:annotation-config />
<tx:annotation-driven />
<context:component-scan base-package="com.meera.liferay.spring.controller" />
<bean id="portletModeHandlerMapping"
class="org.springframework.web.portlet.handler.PortletModeHandlerMapping">
<property name="portletModeMap">
<map>
<entry key="view">
<ref bean="contactController" />
</entry>
</map>
</property>

and controller is like as follows

@Controller("contactController")
@RequestMapping("VIEW")
public class ContactController {

}



Please have look into following link and get the portlet and look into source code it may help you.

http://www.liferaysavvy.com/2013/12/liferay-spring-portlet.html

Regards,
Meera Prince
srinivasa rao, módosítva 10 év-val korábban

RE: org.springframework.web.portlet.NoHandlerFoundException: No matching ha

Regular Member Bejegyzések: 189 Csatlakozás dátuma: 2014.01.29. Legújabb bejegyzések
Hi,

Thanks for ur reply meera prince.

After adding this controller in Portletname.xml
i got one new error.

Error creating bean with name 'portletModeHandlerMapping' defined in ServletContext resource [/WEB-INF/spring_portlet-portlet.xml]: Cannot resolve reference to bean 'MYFirstSpringMVCTestController' while setting bean property 'portletModeMap' with key [TypedStringValue: value [view], target type [null]];

this will showing tht target value is null.

i m fully confused..while creating in spring portlet in xml.
thumbnail
meera prince, módosítva 10 év-val korábban

RE: org.springframework.web.portlet.NoHandlerFoundException: No matching ha

Liferay Legend Bejegyzések: 1111 Csatlakozás dátuma: 2011.02.08. Legújabb bejegyzések
Hi

Do one thing simple get portlet from my download location use that directly and change according to your requirement

OR

Look for all configuration files in my portlet and check with your configuration files along with controller.

Make sure annotation references should be same in controller and configuration files.


Regards,
Meera Prince
thumbnail
Harish Kumar, módosítva 10 év-val korábban

RE: org.springframework.web.portlet.NoHandlerFoundException: No matching ha

Expert Bejegyzések: 483 Csatlakozás dátuma: 2010.07.31. Legújabb bejegyzések
Looks like you are trying to call action method but no action method is defined in your controller class.

have a look at http://www.liferayzone.com/2012/07/spring-mvc-portlet-liferay.html

I have developed this example using Liferay 6.1.2.
sumit Dubey, módosítva 8 év-val korábban

RE: org.springframework.web.portlet.NoHandlerFoundException: No matching ha

New Member Bejegyzések: 4 Csatlakozás dátuma: 2014.12.25. Legújabb bejegyzések
Hi,
You need to do only one thing in your context.xml file under the context:component-scan tag.Just match the package of controller class properly.

like : <context:component-scan base-package="com.impulse.voice.cda" />
.....emoticon