Hi Struts users,

I am developing a web based reporting system using Struts, and one
requirement is that each customer can have their own tailored version
of the reports.

I use tiles to define each report page for each customer, and for each
page for each customer I define a <forward> element in the
<global-forwards>. In the Actions, I look up what Customer is
performing the Action and return the approprate ActionForward. This
works just fine functionally, but it is turning into a maintenance
issue.

In struts-config.xml, I have a <forward> element for each customer for
each report page where the name and path is prefixed with a
CustomerId;

...
<forward name="customer1id.summary" path="customer1id.summary" ... />
<forward name="customer2id.summary" path="customer2id.summary" ... />
<forward name="customer3id.summary" path="customer3id.summary" ... />
<forward name="customer1id.overview" path="customer1id.overview" ... />
<forward name="customer2id.overview" path="customer2id.overview" ... />
...

where the path is tiles definition names. I realise that I must have a
unique path for each report page for each Customer, but ideally I
would not declare these in struts-config.xml, and in my Actions, I
would not look up the Customer performing the Action, but just return
a Customer ignorant forward;

in my Action:
...
return mapping.findForward("summary");

in struts-config.xml
<forward name="summary" path="summary" ... />

and then plug in some kind of mechanism to the struts framework that
was able to determine the forward path for the current Customer for
the given forward name.

This would save me a lot of typing in the struts-config.xml and would
clean up my Action classes of the necessary customer aware forward
lookup.

Am I making any sense here? Have anybody had similary issues and found
a decent solution that they would like to share? Is the solution I
described possible to implement easily?

Best Regards
Bent André

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

Reply via email to