• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Error: DispatchMapping[/login] does not define a handler property

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting this error when i try to implement the DispatchAction class "DispatchMapping[/login] does not define a handler property".

public class LoginAction extends DispatchAction {


public ActionForward add(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception
{
return mapping.findForward("login1");
}

public ActionForward update(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception
{
return mapping.findForward("login2");
}

public ActionForward delete(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception
{
return mapping.findForward("login3");
}
}

I have imported the necessary classes for the same.

My action mapping looks like following
<action name="LoginForm"
path="/login"
scope="request"
type="net.tennet.loginstruts1.actions.LoginAction"
input="/jsp/Login.jsp">
<forward name="login1" path="/jsp/success1.jsp"/>
<forward name="login2" path="/jsp/success2.jsp"/>
<forward name="login3" path="/jsp/success3.jsp"/>
</action>
Now i try to use this code to call the individual methods.
<html:link target="_self" page="/login.do?function=add">Link1</html:link>

and so i get the above error. Any ideas as to why this is happening?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to add

parameter="function"

to your <action> tag in struts-config.xml.

This is what tells the DispatchAction Class the name of the request parameter that is to control the logic flow.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey !!
If Still is giving error than do one thing...
use action instead of page in <a href> tag..

Because, action tag is more convenient than Page when you are calling an action specifically....

andPage is used when you wnat to forward request to any JSP page directly
 
I don't even know how to spell CIA. But this tiny ad does:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic