• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Struts Modules

 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The project that I have been working on for the past few years started with Struts 1.0. This project has grown and our single struts-config file now has 306 form-bean definitions and 1612 action definitions. This has actually not been a huge problem. We have version control setup to allow multiple checkouts and even a lowly tool like Visual Source Safe is pretty good at merging changes to an xml document. The project occasionally needs to do work on a branch, and it is a bit of a pain trying to merge two struts-config files that have had numerous changes (something that I am doing now).

I do think that splitting our monstrous config file up into multiple files would generally be a good thing. Looking at the Struts documentation I see that I can specify a single module with multiple configuration files, or I can create multiple modules each with their own configuration file. I have read a few articles about configuring modules, but there are a few things that I do not understand.

Does the module name always appear in the URL? If I create an entry for "config/catalog" will my url look like "xyz.com/app/catalog/purchase.do"? I take it that this module name also shows up in my html:form tags.

I also do not fully understand the functionality or need for the SwitchAction. I also do not really understand was it means to switch from one module to another. It seems like I just need to specify contextRelative="true" in the forward and include the module as the first part of the path.

What about tiles-def and resource files? Can those be split up as well?

- Brent
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow, 1612 actions! That's quite an application.

I haven't used modules much either, but I've played around with them a little. At the risk of being the blind leading the blind, I'll take a stab at your questions.

Does the module name always appear in the URL?
If I create an entry for "config/catalog" will my url look like "xyz.com/app/catalog/purchase.do"? I take it that this module name also shows up in my html:form tags.



The answer is yes to all of the above.

I also do not fully understand the functionality or need for the SwitchAction. I also do not really understand was it means to switch from one module to another. It seems like I just need to specify contextRelative="true" in the forward and include the module as the first part of the path.



I'm with you on this one, Brent. I don't really see the need for SwitchAction either. There are easier ways of switching modules

What about tiles-def and resource files? Can those be split up as well?



Since the location and name of these resources are defined in each module's configuration file, you have the choice of having each of your configuration files point to the same resource, or having them each point to separate resources. The same goes for validation definitions.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the input. Before I advocate that we divide up the application I will play around a little with modules for new development. The last 3 Struts based applications that I have worked on started with 1.0, and none of them have switched over to using modules.

- Brent
 
reply
    Bookmark Topic Watch Topic
  • New Topic