• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DispatchAction called with different action name

 
kavin clain
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of my action class extends DispatchAction: having methods- add, edit & remove.

register.do mapped to the action class. I must call actions this way: register.do?method=add, register.do?method=edit & register.do?method=remove.

I am using same FormBean-extends-ValidatorActionForm for these methods.

Is it possible to use different actions & invoke these methods: enroll.do?method=add, format.do?method=edit & discard.do?method=remove.

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kavin clain wrote:Is it possible to use different actions & invoke these methods: enroll.do?method=add, format.do?method=edit & discard.do?method=remove.

You can map the whatever a URL you want to map with the given Action, just make sure that the action contains the method you're passing, like in your example, the methods must be. "add, edit, remove".

You can do like this
For first case: enroll.do?method=add,
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more thing, from your case, its good use of MappingDispatchAction

In that case, you don't even have to append the query string, like
For first case: enroll.do?method=add,

and the resultant URL will be: enroll.do, simple
 
kavin clain
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Sagar... I wish to use MappingDispatchAction.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic