Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do I have a seperate springMVC controllor for every action?

 
Glenn Timchishen
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I'm trying to model my web app I�m creating and I can't figure out how to map the controllers to the model.

Ok so if I have a OrderManager class that can "process and order", "edit the quantity of the order", or "cancel an order"

Do I create 3 controller classes that launch the three different methods?

or do I create one controller that somehow decides which task I want it to do, which then launches the specific object.method()??


Any help would be appreciated.
 
Praveen Babu
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Glenn,

Consider using MultiActionController. Its much like Aggregate Actions in Struts which means a set of related actions as a single action class.

Refer to Spring documentation for the spring related syntax.

Regards,
P R A V E E N
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic