File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Hierarchical Organization of Struts Modules Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Hierarchical Organization of Struts Modules" Watch "Hierarchical Organization of Struts Modules" New topic

Hierarchical Organization of Struts Modules

Urso Wieske

Joined: Jun 21, 2002
Posts: 2
<p>I have conceptually organized my web application in two layers. Actually, it's a tree structure whose root (layer one) is associated with the default Struts Module (struts-config-default.xml) and the children of the root (on the second layer) are associated with corresponding Struts Modules (let's day mod1 , mod2, mod3 and mod4).</p>

(struts-config-default refix=/)
/ / \ \
/mod1 /mod2 /mod3 /mod4

<p>The problem is that a module is selfcontained and independent.</p>

<p>What I want based on my tree organization is to define a global exception in my top level module (the default struts module). This global exception declaration applies to all descendant modules mod1 to mod4. AND I DO NOT want to declare a global exception in mod1 to mod4! (After all, what's the point of having redundant declarations which do the samething: handle a system error).
Apparently this approach is not possible because there is no way to tell Struts about the relationship "Parent-Child (i.e. default module - child module mod1 relationship).</p>

<p>A module does not know anything about other modules. They are independent from each other. I 'm in favour for this struts module principle.
But this principle has obviously a downside too.</p>

<p>I have tried to use contextRelative attribute in global exception tag to let Struts know that it should divert to the global-exception in the default module, but this tag does not know anything about the attribute contextRelative.</p>

<p color="#FF0000">Question: does any one has a working solution for this approach?</font>
Urso Wieske</p>

U.G.R. Wieske<br />Amsterdam, Netherlands
I agree. Here's the link:
subject: Hierarchical Organization of Struts Modules
It's not a secret anymore!