In my web project, I divide actions up logically by what they deal with. For your menu example, I'd have MenuAction. For displaying data pages, I have PageAction. I also separate management of the various data types out into ManagementAction classes, one for each data type.

Calling the actions this way is a little easier; I don't need to pass a type, just an ID - the action definitions in struts.xml take care of the rest. Also, the code ends up being better-organized than if I had one action class to handle all different sorts of actions.

Good luck!

-Brian



janbrito wrote:
Hi,

I'm building a portal using Struts, Spring, Hibernate and Velocity, and
right now I only have the login action ready. What I would like to know is
how to handle all requests once the user is logged in. Do I have to create
an action class to handle all user clicks on the portal? If the user clicks
on a menu then I would call this main action class passing a parameter
type="menu" and also the id=menuID. If the user clicks in a link within a
menu content, I would call this action class passing type="article" and
id=articleID. Using this methodology I would have a switch to handle the
different types.

Is this a good practice? if not, what would be the best practice?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to