By: Emiley J. Emailed: 1728 times Printed: 2341 times
1. Extend When You Must
•Struts framework can be stretched and customized to allow for customized behavior.
•Configuration classes in the Struts framework (say, Struts configuration file , ActionServlet RequestProcessor) can be substituted for a customized version.
•Declarative Exception Handling mechanism also allows for custom exception handlers to be used to better respond to application failures.
•Extension should be done judiciously.
•Before extending a Framework, we should always make sure that the functionality doesn't already exist somewhere.
2. Use Application Modules
•Splitting of a single Struts application into multiple modules is allowed.
•This solves one of the biggest complaints that development groups of more than a few people have had for some time because we can create Separate Struts Configuration Files for Individual Applications.
•Each Struts application module should have its own configuration file. This allows us to configure separate Actions, ActionForms, exception handling, and much more, independent of other application modules.
3. Use Declarative Exception Handling
•Struts framework includes a class called ExceptionHandler.
•This class by default is responsible for processing any exceptions that occur during action execution.
•This class actually creates an ActionError object and stores it in the appropriate scope object.
•This allows the JSP pages to use the errors to inform the user of a problem.
•Customized ExceptionHandler classes can also be used.
4. Use a Base Action for your application
•Often, Actions in an application will need to perform some basic tasks.
•To ensure these tasks are implemented consistently, create a base Action that can be sub-classed by other actions in the application.
5. Check logins at the Controller Leveljkmx
6. Use Validator Framework for validating user input
7. Use Custom tags instead of using scriplets and Java code in JSP pages..,
View Tutorial By: Jaime at 2011-10-24 12:47:50
View Tutorial By: Jair Aviles at 2011-11-22 05:49:05
View Tutorial By: Keerthi at 2012-01-11 11:28:24
View Tutorial By: Deepika at 2012-03-26 05:10:15
View Tutorial By: bal mukund at 2012-08-21 05:42:36
View Tutorial By: dinesh at 2014-10-20 16:44:26
Most Viewed Articles (in Struts )
Most Emailed Articles (in Struts)