struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adam pinder <>
Subject RE: How to structure a struts2 application
Date Fri, 24 Sep 2010 15:30:47 GMT


one action per function or functional area is probably best.


you can then tailor the validation and responses more easily.



> Date: Fri, 24 Sep 2010 10:35:42 +0100
> Subject: How to structure a struts2 application
> From:
> To:
> Hi,
> I have just started learning struts2 and was wondering what is the best way
> to structure my application.
> I was planning on creating one ActionSupport class to deal with all user
> action (creating, editing, login etc). This would have a method for each
> type of action (create(), login() etc) and a mapping with a wildcard like
> this:
> <action name="*User" class="" method="{1}">
> However im not sure if this is the best way of doing things because all of
> the user actions would share the same validate method, and each different
> type of action would need different validation. I was thinking of maybe
> putting a switch in the validate method to do different validation depending
> on which action has been called, or perhaps just having different action
> classes for each type of user action. Do either of these approaches sound
> sensible? Or am I missing an easier way to go about grouping up all the user
> actions?
> Regards
> Darren
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message