I wasn't involved in implementing modules, but from discussions and
experience, my understanding is that modules are conceived as pretty
isolated components, despite the fact that they are in one web
application.
It is possible to switch between modules using the SwitchAction, for
instance, and the JSP tags have some support for indicating paths in
alternate modules (which has mostly happened since the 1.1 release).
In my development, my primary motivation was simply to
compartmentalize the config files. Once I learned that you can
specify any number of struts-config.xml files in web.xml and,
similarly, you can specify any number of tiles and validation files
in the plugin configurations for those components, I haven't used
modules.
I've become quite fond of a pattern like this:
/WEB-INF/sectionA/struts-config.xml
/WEB-INF/sectionA/tiles-definitions.xml
/WEB-INF/sectionA/validation.xml
/WEB-INF/sectionB/struts-config.xml
/WEB-INF/sectionB/tiles-definitions.xml
/WEB-INF/sectionB/validation.xml
/sectionA/Foo.jsp
/sectionA/Bar.jsp
/sectionB/Baz.jsp
/sectionB/Qux.jsp
/sectionB/Quux.jsp
This parallelism keeps any individual config file from getting too
large while providing a pretty clear rule for where to go looking for
the various components of a solution. It can sometimes be unclear
how to section things, but mostly it's very straightforward.
I think many developers begin using modules expecting more
interoperability and perhaps hierarchical configuration. Since
Struts is open source, there's no reason people couldn't build that
out -- but I've found that I don't actually need modules, so I don't
use them.
Joe
At 3:12 PM -0700 5/26/04, Ashwin Desai wrote:
Hi,
I have two modules in my application
Module A -> default (contains common functionality like logout etc)
Module B -> specific funtionality developed by a separate team.
Can actions in module B have access to the ones in Module A ?
i.e. can I lookup a Struts Action defined in Module A from doing a
lookup in an Action defined in Module B & vice versa ?
Do modules in Struts follow any hierarchial structure ?
--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"Imagine if every Thursday your shoes exploded if you tied them
the usual way. This happens to us all the time with computers, and
nobody thinks of complaining."
-- Jef Raskin
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]