struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richards, Devin N (Devin)" <>
Subject RE: multiple sub projects
Date Fri, 06 Sep 2002 20:00:11 GMT
We have deployed our first struts project that was composed of three disjoint applications.
After reading this thread I am attempting to make them each a sub-project in struts.

Question 1: We currently use one file for all three projects
due to the way the validator works (it does not take the bundle argument.) Is there a way
for the sub-projects to pull in (i.e. merge) their local with
a "global" one? Or should we postpone the use of the validator, manually code the rules in
the validate() method not the validation.xml and use multiple <message-resource> definitions?

Question 2: As all of our pages share a common look and feel they are all based on a standard
tiles definition. Is it possible to create some "global" tiles definitions that each of these
sub-projects can extend, or do we need to reproduce the entire tiles-def.xml for each sub-project?

TIA for your help/advice


-----Original Message-----
From: Craig R. McClanahan []
Sent: Friday, August 16, 2002 4:29 PM
To: Struts Users Mailing List
Subject: Re: multiple sub projects

On Fri, 16 Aug 2002, Michael Delamere wrote:

> Date: Fri, 16 Aug 2002 21:38:49 +0200
> From: Michael Delamere <>
> Reply-To: Struts Users Mailing List <>
> To: Struts Users Mailing List <>
> Subject: multiple sub projects
> Hi,
> I´ve just read some chapters from the oreilly struts book in order to find
> out more about creating multiple sub-projects.  Very nice book!
> Ok, I know how to define another struts-config xml.  But in the case of the
> order example how do I tell struts to use the struts-order-config.xml?
> -> use struts-order-config.xml
> Could someone provide me with an example please or send me a link where I
> can find out more.

The key is in the module prefixes.

Let's say your webapp is installed under context path "/myapp" and you
have the following configuration settingss in your web.xml file:



Now, a path like "/myapp/foo/" will go to the "/foo" module, while
paths like "/myapp/bar/" will go to the "/bar" module.  You do the
same things with your JSP pages -- put them in "/foo" and "/bar"
subdirectories under the context root.

Note that *inside* the struts-config.xml file for a module, you do not
include the module prefix in any of the paths.  In other words, in each
module you'd still have an <action path="/order" ...> element.  Struts
will tack the module prefix onto the front where necessary, just like it
adds the context path for your webapp automatically.

> Any help would be appreciated,
> thanks,
> Michael


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message