For now, I think we're going to just use the multiple
config file options (new in B3). I was able to bust up our ONE
struts-config.xml file and get this working in just 1/2 day (it would have been
less if I wouldn't have introduced some XML syntax errors in my new
config files). In addition, we'll probably bust up our
application resource file and merge them back together during our ANT build
process. We have a team of about 12 developers, so these files have become
a real bottleneck. This approach seems to achieve many of the same
benefits as modules, without all the additional technical headaches
(although you need to guard against duplicate action mappings, form bean
definitions, keys/values across all the collection of files).
-----Original Message-----
From: Niesen, Nathan
[mailto:[EMAIL PROTECTED]
Sent: Wed 3/26/2003 4:43 PM [EMAIL PROTECTED]
To: Struts-User
(E-mail)
Cc:
Subject: RE: Configuring Tiles + Validation
+ Modules
I basically have the same questions. I've been searching the
user docs and
mailing lists trying to get a handle on
what modules were intended to do,
what modules can and
can't do, and how I can use modules to improve my
application framework. It appears to me that the modules feature opened
up a
whole can-o-design-worms and they're still
wiggling. I can't find anything
that clearly defines
intended usage of modules or the limitations of
modules; especially in regards to using "resources" outside of a
modules
sub-directory.
In addition to John's questions, I have the following
question:
1) How can I use tiles/templates to assemble a page in one
module from
reusable "components/pages" in one or more
other modules? For example: I
have pages in modules B,
C, and D, that all want to pull in a menu page from
my
default module as well as a reusable page from module A.
Other issues with modules:
1) Not all tags (html:img in particular) use the pagePattern
or
forwardPattern attributes from the controller. If I
want to use an image in
my header.jsp, the image file
has to be physically located in each module or
I get a
broken link.
2) The pagePattern and forwardPattern are defined on the
controller which
means all tag or forward URLs for the
module will be mapped to the same
context relative
URL. I think it would be more flexible if you simply
specified the pattern as part of the URL attribute for the tag or
forward.
For example: <html:img alt="get an image
from the default module"
page="$P/header.gif"/> and
<html:img alt="get an image from the current
module" page="$M$P/module.gif"/>
3) The examples don't effectively demonstrate the effects that
the
contextRelative, inputForward, pagePattern, and
forwardPattern attributes
have on the page, forward,
action, and href attributes.
4) The examples only show how to switch from one
self-contained module to
another. They don't
demonstrate how to combine resources/pages from multiple
modules into a single page via either includes or
tiles/templates.
Thanks, Nathan.
-----Original Message-----
From:
Hohlen, John C [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 26, 2003 8:20
AM
To: Struts-User
(E-mail)
Subject: Configuring Tiles +
Validation + Modules
I'm looking for some help on how to configure the Tiles and
Validation
Plug-Ins. A lot of the good books
(Struts In Action, Programming Jakarta
Struts, etc.)
and replies to the mailing list address these topics
independently, but not collectively. In addition, I took a look
at James
Holmes "Switching Modules" example, but that
focuses on the different ways
to switch b/t modules,
not on how to configure Modules with Tiles and the
Validation frameworks.
For discussion purposes, let's assume I have following 3
modules (default,
modA, modB). Here are my
questions:
1) If I have a form bean definition used by all 3 modules,
does it need to
be defined in each of the 3
struts-config files, or can I just declare it in
the
default struts-config?
2) Does each modules' struts-config file need the following
declaration to
use the Validation framework, or can I
simply declare this once in the
config file for the
default module?
<plug-in
className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>
3) For Tile Definition config files, can all of these just be
declared in
the default struts-config, or should they
be declared in the module
struts-config they
correspond to (assuming you've divided your Tile
definitions by module)? For example:
<plug-in
className="org.apache.struts.tiles.TilesPlugin" >
<set-property
property="definitions-config"
value="/WEB-INF/tiles-defs-default.xml,
/WEB-INF/tiles-defs-modA.xml,
/WEB-INF/tiles-defs-modB.xml"/>
</plug-in>
4) Can I use the default module's application resource file
for text common
across modules? Therefore,
preventing me from having to duplicate entries
across
modules. If so, this means Struts always looks in the particular
module's application resource first, then the default
module. But this
doesn't apply for form bean
definitions or action mappings, correct?
5) Is the following an acceptable way to configure the
application resource
files:
--- struts-config.xml (default) -------
<message-resources parameter="Messages"
null="false"/>
--- struts-config-modA.xml (default) -------
<message-resources parameter="Messages-modA"
null="false"/>
--- struts-config-modB.xml (default) -------
<message-resources parameter="Messages-modB"
null="false"/>
Thanks in advance for your help,
JOHN
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For
additional commands, e-mail: [EMAIL PROTECTED]