File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Problem with DispatchAction. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with DispatchAction." Watch "Problem with DispatchAction." New topic
Author

Problem with DispatchAction.

peter aerts
Ranch Hand

Joined: Jan 22, 2009
Posts: 32

Hello.
I am getting this error when I am trying to call a Action which has extended a DispatchAction.
Request[/admin] does not contain handler parameter named action.




The Class AdminAction is as follows:



The struts-config is as follows:


Please Help me.
thank you.
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874

Request[/admin] does not contain handler parameter named action


Is this your comlete Actionclass AdminAction ? I think you missed the declare and implement the method called "action" as specified in "parameter" attribute in action tag.


parameter="action"

Check out this
DispatchAction for more information.
peter aerts
Ranch Hand

Joined: Jan 22, 2009
Posts: 32

thank you Balu Sadhasivam for your responce.
yes this is my complete AdminAction.
as you can see in action tag,i have parameter="action".
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Does the request contain the "action" parameter?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I don't know if this is causing the problem you're currently experiencing or not, but one should never use the name action for the parameter used in DispatchAction. The reason for this is that in HTML, a FORM has an action parameter, which is the URL to be executed when the form is submitted. Therefore, having an input element named "action" can confuse things and cause strange errors. Use some other name such as "actionMethod".


Merrill
Consultant, Sima Solutions
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

How can a parameter named "action" can interfere with a form tag's "action" attribute?
peter aerts
Ranch Hand

Joined: Jan 22, 2009
Posts: 32

Thank you everybody for your ideaes.
I found the problem.
I use the dispatchMethod to dispatch to the specified method(menuList method of AdminAction class)at this program and everythings is ok now.



dispatchMethod is in the AdminAction class too.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with DispatchAction.