struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charlesmel Carino <>
Subject Re: Designing application using Struts
Date Mon, 13 Apr 2009 18:54:56 GMT

I've answered that question from my previous employer and what I did was to basically reuse
the form because
it was used everywhere in the application. The persistent evil of copy and pasting whoever
coded it possessed him
because he replicated the same form 17 times. Which means the form was used at 17 different

I pulled my hair and started designing only 1 form for the entire 17 different places. I coded
it and it worked. I've used a Facade Design Pattern
that basically implements an interface where it knows what actions are associated with the
form of interest. It knows how to pass the parameters
to the right Action class. Your mapping forward can go to a different action common to all
that can control the behavior of your form page. From you
struts.config.xml file you can specify all those different actions to go to this one action
that takes care of initializing/setting/routing your form of interest.

Hope that gives you some details to start with.


From: Niklas Johansson <>
Sent: Monday, April 13, 2009 2:12:17 PM
Subject: Designing application using Struts


I got some design questions when using Struts. If this is not the right place to post this
kind of questions please let me know and I can create a QuickTopic. 

I am creating an application that contains several forms. Two of the forms belongs to two
different parts which can be considered seperate applications (e.g. one is kind of an incident
application). My plan is that I shall create these applications later as stand-alone applications.

I am thinking about how to best put this code together. Here is my thoughts:

Some high level requirements:
R1. I want to make it easy to use the forms at different place in the application.
R2. I want to make it easy to apply changes anywhere in the application as the application

Thoughs about the design: 
D1. Creat my own UI components for each form. 
D2. Use parameterised Factory pattern for chosing which form to use. The actual  tag, or all
of them, for the chosen form should be returned in this case. 

Is this a good way of doing it or are there better ways of doing it? Any suggestions is most
appreciated since I am totally new with Struts and I am trying to learn the nature of using

Thank you in advance!

Best Regards,

News, entertainment and everything you care about at Get it now!
To unsubscribe, e-mail:
For additional commands, e-mail:
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message