struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niesen, Nathan" <nathan.nie...@objectfx.com>
Subject RE: Configuring Tiles + Validation + Modules
Date Wed, 26 Mar 2003 22:43:04 GMT

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:John.C.Hohlen@erac.com] 
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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message