PDA

View Full Version : problem in multiaction controller No request handling method with name



ganesh pol
May 1st, 2006, 04:31 AM
friends
i have got following warning message whenever i select link from jsp page



WARNING: No request handling method with name 'getUsersAllUnsentExpenses' in class 'com.dss.ems.web.controller
s.multiaction.EmsMultiActionController'


java code

public class EmsMultiActionController extends AbstractMultiActionController {
public ModelAndView getUsersAllUnsentExpenses(HttpServletRequest request){
//my code
}

where AbstractMultiActionController is subclass of MultiActionController



<bean id="emsMultiactionController"
class="com.dss.ems.web.controllers.multiaction.EmsMultiAc tionController">
<property name="methodNameResolver">
<ref bean="emsMethodNameResolver"/>
</property>
</bean>


<bean id="emsMethodNameResolver"
class="org.springframework.web.servlet.mvc.multiaction.Pr opertiesMethodNameResolver">
<property name="mappings">
<props>
<prop key="/draft.ems">getUsersAllUnsentExpenses</prop>
</props>
</property>
</bean>

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<prop key="/draft.ems">emsMultiactionController</prop>



part of jsp page is

<A href="<%=request.getContextPath()%>/draft.ems">
<font color="#00009F"
face="arial"
size="1"><B>DRAFT</B>
</font>
</A>


how to solve this problem

Colin Yates
May 1st, 2006, 05:15 AM
Check out the javadoc: http://www.springframework.org/docs/api/org/springframework/web/servlet/mvc/multiaction/MultiActionController.html

It describes the legal method signatures:


ModelAndView getUsersAllUnsentExpenses(HttpServletRequest request, HttpServletResponse response);

or


long getUsersAllUnsentExpenses(HttpServletRequest request);

HTH

ganesh pol
May 1st, 2006, 05:45 AM
thanks yatesco
as u said i change the method signature


but problem is not solved yet now i got warning such as

01-May-2006 16:24:43 org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController handleRequestIntern
al
WARNING: No handling method can be found for request [org.apache.coyote.tomcat5.CoyoteRequestFacade@85e5 7]




public ModelAndView getUsersAllUnsentExpenses(HttpServletRequest request,HttpServletResponse response) {

}

why do we are adding second param as response ?

is it to give response back ?

Colin Yates
May 1st, 2006, 08:32 AM
Not sure why you get that error to be honest. I don't really have much experience with the MAC.

Is your method actually being executed?

ganesh pol
May 1st, 2006, 11:08 PM
can u tell me what is the thumb rule to use controllers

which one to use when

i.e when to use SimpleFormController and MultiActionController

and how to solve above problem

Colin Yates
May 2nd, 2006, 03:00 AM
I always prefer using seperate controllers. I understand why people use MultiActionController, but I do not use it much. Having seperate controllers isn't really that much more work/configuration than the MAC, but seperate controllers gives you a lot more flexibility.

If you have lots of related, trivial operations that are all related, then MAC might be OK. If you have any non-trivial operation than seperate controllers is the way to go.

Just my opinion. Others will disagree. And to be honest, I haven't really disproved MAC through experience, more a gut feeling :)