You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Benedict <pa...@yahoo.com> on 2005/10/12 06:39:44 UTC

Why I Hate Struts Modules

Great subject line, isn't it? :)

OK. I've been doing Struts for like 2-3 years now, and
Struts Modules I loved for awhile but now I absolutely
can't stand them....

First off, my initial appeal to modules was to split
up the configuration files so different developers can
work on the project without people waiting for
check-outs. That sounds like a good deal, but Modules
are MORE than splitting up configuration files - they
are these Berlin Walls kind of construction where
forms and actions can't be shared across them ....
unless you want to define them in multiple config
files.

See, after all these years, I really wanted was to
split files up. Modules don't gain me anything, do
they? I know (or I think) when Craig wrote Struts 0.x,
he had an action.xml which did something similar....
Now I could create file of just actions and use XML
ENTITIES to include them, but I never see people doing
that solution. Is it not well-known or frown upon?

So I am kind of sick of Struts modules. More so, now
that I have to declare my Struts global exception
handler in every config file!! This gets ridiculous
after 5 modules... and forget about it if you have a
project with 50 modules.

Too much configuration duplication. 


		
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Why I Hate Struts Modules

Posted by Hubert Rabago <hr...@gmail.com>.
Yes.

Hubert

On 10/12/05, Adam Hardy <ah...@cyberspaceroad.com> wrote:
> Hubert,
>
> does that work for all config items including global exceptions etc, as
> was discussed earlier?
>
>
> Adam
>
> Hubert Rabago on 12/10/05 17:09, wrote:
> > Paul,
> >
> > You can declare something like a struts-config-common.xml which will
> > contain the config items that are common among your modules and then
> > include them in your config declarations:
> >
> > <param-name>config</param-name >
> > <param-value>
> > /WEB-INF/classes/elms/resource/struts-config-common.xml,
> > /WEB-INF/classes/elms/resource/struts-config.xml
> > </param-value>
> > <param-name>config/module2</param-name >
> > <param-value>
> > /WEB-INF/classes/elms/resource/struts-config-common.xml,
> > /WEB-INF/classes/elms/resource/struts-config-module2.xml
> > </param-value>
> > <param-name>config/module3</param-name >
> > <param-value>
> > /WEB-INF/classes/elms/resource/struts-config-common.xml,
> > /WEB-INF/classes/elms/resource/struts-config-module3.xml
> > </param-value>
> >
> > hth,
> > Hubert
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Why I Hate Struts Modules

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Hubert,

does that work for all config items including global exceptions etc, as 
was discussed earlier?


Adam

Hubert Rabago on 12/10/05 17:09, wrote:
> Paul,
> 
> You can declare something like a struts-config-common.xml which will
> contain the config items that are common among your modules and then
> include them in your config declarations:
> 
> <param-name>config</param-name >
> <param-value>
> /WEB-INF/classes/elms/resource/struts-config-common.xml,
> /WEB-INF/classes/elms/resource/struts-config.xml
> </param-value>
> <param-name>config/module2</param-name >
> <param-value>
> /WEB-INF/classes/elms/resource/struts-config-common.xml,
> /WEB-INF/classes/elms/resource/struts-config-module2.xml
> </param-value>
> <param-name>config/module3</param-name >
> <param-value>
> /WEB-INF/classes/elms/resource/struts-config-common.xml,
> /WEB-INF/classes/elms/resource/struts-config-module3.xml
> </param-value>
> 
> hth,
> Hubert
> 
> On 10/11/05, Paul Benedict <pa...@yahoo.com> wrote:
> 
>>Great subject line, isn't it? :)
>>
>>OK. I've been doing Struts for like 2-3 years now, and
>>Struts Modules I loved for awhile but now I absolutely
>>can't stand them....
>>
>>First off, my initial appeal to modules was to split
>>up the configuration files so different developers can
>>work on the project without people waiting for
>>check-outs. That sounds like a good deal, but Modules
>>are MORE than splitting up configuration files - they
>>are these Berlin Walls kind of construction where
>>forms and actions can't be shared across them ....
>>unless you want to define them in multiple config
>>files.
>>
>>See, after all these years, I really wanted was to
>>split files up. Modules don't gain me anything, do
>>they? I know (or I think) when Craig wrote Struts 0.x,
>>he had an action.xml which did something similar....
>>Now I could create file of just actions and use XML
>>ENTITIES to include them, but I never see people doing
>>that solution. Is it not well-known or frown upon?
>>
>>So I am kind of sick of Struts modules. More so, now
>>that I have to declare my Struts global exception
>>handler in every config file!! This gets ridiculous
>>after 5 modules... and forget about it if you have a
>>project with 50 modules.
>>
>>Too much configuration duplication.
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Why I Hate Struts Modules

Posted by Hubert Rabago <hr...@gmail.com>.
Paul,

You can declare something like a struts-config-common.xml which will
contain the config items that are common among your modules and then
include them in your config declarations:

<param-name>config</param-name >
<param-value>
/WEB-INF/classes/elms/resource/struts-config-common.xml,
/WEB-INF/classes/elms/resource/struts-config.xml
</param-value>
<param-name>config/module2</param-name >
<param-value>
/WEB-INF/classes/elms/resource/struts-config-common.xml,
/WEB-INF/classes/elms/resource/struts-config-module2.xml
</param-value>
<param-name>config/module3</param-name >
<param-value>
/WEB-INF/classes/elms/resource/struts-config-common.xml,
/WEB-INF/classes/elms/resource/struts-config-module3.xml
</param-value>

hth,
Hubert

On 10/11/05, Paul Benedict <pa...@yahoo.com> wrote:
> Great subject line, isn't it? :)
>
> OK. I've been doing Struts for like 2-3 years now, and
> Struts Modules I loved for awhile but now I absolutely
> can't stand them....
>
> First off, my initial appeal to modules was to split
> up the configuration files so different developers can
> work on the project without people waiting for
> check-outs. That sounds like a good deal, but Modules
> are MORE than splitting up configuration files - they
> are these Berlin Walls kind of construction where
> forms and actions can't be shared across them ....
> unless you want to define them in multiple config
> files.
>
> See, after all these years, I really wanted was to
> split files up. Modules don't gain me anything, do
> they? I know (or I think) when Craig wrote Struts 0.x,
> he had an action.xml which did something similar....
> Now I could create file of just actions and use XML
> ENTITIES to include them, but I never see people doing
> that solution. Is it not well-known or frown upon?
>
> So I am kind of sick of Struts modules. More so, now
> that I have to declare my Struts global exception
> handler in every config file!! This gets ridiculous
> after 5 modules... and forget about it if you have a
> project with 50 modules.
>
> Too much configuration duplication.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Why I Hate Struts Modules

Posted by James Mitchell <ja...@mac.com>.
http://www.junlu.com/msg/93974.html

--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   jmitchell@apache.org
Skype: callto://jmitchtx





On Oct 12, 2005, at 12:39 AM, Paul Benedict wrote:

> Great subject line, isn't it? :)
>
> OK. I've been doing Struts for like 2-3 years now, and
> Struts Modules I loved for awhile but now I absolutely
> can't stand them....
>
> First off, my initial appeal to modules was to split
> up the configuration files so different developers can
> work on the project without people waiting for
> check-outs. That sounds like a good deal, but Modules
> are MORE than splitting up configuration files - they
> are these Berlin Walls kind of construction where
> forms and actions can't be shared across them ....
> unless you want to define them in multiple config
> files.
>
> See, after all these years, I really wanted was to
> split files up. Modules don't gain me anything, do
> they? I know (or I think) when Craig wrote Struts 0.x,
> he had an action.xml which did something similar....
> Now I could create file of just actions and use XML
> ENTITIES to include them, but I never see people doing
> that solution. Is it not well-known or frown upon?
>
> So I am kind of sick of Struts modules. More so, now
> that I have to declare my Struts global exception
> handler in every config file!! This gets ridiculous
> after 5 modules... and forget about it if you have a
> project with 50 modules.
>
> Too much configuration duplication.
>
>
>
> __________________________________
> Yahoo! Music Unlimited
> Access over 1 million songs. Try it free.
> http://music.yahoo.com/unlimited/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Why I Hate Struts Modules

Posted by Michael Jouravlev <jm...@gmail.com>.
On 10/11/05, David G. Friedman <hu...@ix.netcom.com> wrote:
>  Paul,
>
> > See, after all these years, I really wanted was to
> > split files up. Modules don't gain me anything, do
> > they? I know (or I think) when Craig wrote Struts 0.x,
> > he had an action.xml which did something similar....
> > Now I could create file of just actions and use XML
> > ENTITIES to include them, but I never see people doing
> > that solution. Is it not well-known or frown upon?
>
> I'd only heard once on this list about the XML entities trick.  Personally,
> I'd prefer that one like that if I were creating anything large enough to
> warrant breaking the configuration down into multiple files/modules. :)

Entities are a standard XML thing. Here is another trick, though it is
a bit offtopic. Say, you want to output data to XML. And you have a
regular structure of XML elements, like this:

<body>
  <element>some stuff</element>
  <element>some more stuff</element>
  <element>event some more stuff</element>
<body>

You can do that in an XML file, but you cannot simply append to the
file, because you always need to close <body> to keep XML well-formed.
So, here is what you do:

header.xml:
-------

<?xml version="1.0"?>
<!DOCTYPE MYDOCUMENT [
<!ENTITY content SYSTEM "content.xml">
<!ELEMENT BODY (RECORD*)>
]>
<BODY>&content;</BODY>

content.xml:
------
<RECORD>Some stuff</RECORD>
<RECORD>Some more stuff</RECORD>
<RECORD>And some more stuff</RECORD>

Voila. Now you can append <RECORD> elements to the content.xml file,
and resulting document will stay well-formed.

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Why I Hate Struts Modules

Posted by Don Brown <do...@gmail.com>.
Why not have the best of both? I've found this trick to be handy:
1. Define a common config file that contains items you want to share
2. For each module, specify both the common and module-specific
configuration file. At runtime, they will be treated as if they were one big
file to begin with.

This technique is especially potent with the new "extends" attribute
available with Struts 1.3.

Don

On 10/11/05, David G. Friedman <hu...@ix.netcom.com> wrote:
>
> Paul,
>
> > See, after all these years, I really wanted was to
> > split files up. Modules don't gain me anything, do
> > they? I know (or I think) when Craig wrote Struts 0.x,
> > he had an action.xml which did something similar....
> > Now I could create file of just actions and use XML
> > ENTITIES to include them, but I never see people doing
> > that solution. Is it not well-known or frown upon?
>
> I'd only heard once on this list about the XML entities trick. Personally,
> I'd prefer that one like that if I were creating anything large enough to
> warrant breaking the configuration down into multiple files/modules. :)
>
> Regards,
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Why I Hate Struts Modules

Posted by Paul Benedict <pa...@yahoo.com>.
Frank,

I didn't know this. I thought the only way to chunk up
the Struts config was to define modules, because only
one XML could be specified..... well now that I know I
can have one (default) module that contain all my
configurations, I am chucking the modules. :-)

Paul

--- "Frank W. Zammetti" <fz...@omnytex.com> wrote:

> Paul, you are aware that you can specify multiple
> configuration files, 
> right?  There isn't even a need to use XML entities,
> which I suspect 
> isn't as well-known as it probably should be, and
> another poster pointed 
> out that it presents some troubleshooting (or was it
> validation?) 



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Why I Hate Struts Modules

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Paul, you are aware that you can specify multiple configuration files, 
right?  There isn't even a need to use XML entities, which I suspect 
isn't as well-known as it probably should be, and another poster pointed 
out that it presents some troubleshooting (or was it validation?) 
problems.  I think multiple config files gives you what you want though.

http://struts.apache.org/userGuide/configuration.html#dd_config_servlet

David G. Friedman wrote:
>  Paul,
> 
> 
>>See, after all these years, I really wanted was to
>>split files up. Modules don't gain me anything, do
>>they? I know (or I think) when Craig wrote Struts 0.x,
>>he had an action.xml which did something similar....
>>Now I could create file of just actions and use XML
>>ENTITIES to include them, but I never see people doing
>>that solution. Is it not well-known or frown upon?
> 
> 
> I'd only heard once on this list about the XML entities trick.  Personally,
> I'd prefer that one like that if I were creating anything large enough to
> warrant breaking the configuration down into multiple files/modules. :)
> 
> Regards,
> David
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> .
> 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Why I Hate Struts Modules

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
 Paul,

> See, after all these years, I really wanted was to
> split files up. Modules don't gain me anything, do
> they? I know (or I think) when Craig wrote Struts 0.x,
> he had an action.xml which did something similar....
> Now I could create file of just actions and use XML
> ENTITIES to include them, but I never see people doing
> that solution. Is it not well-known or frown upon?

I'd only heard once on this list about the XML entities trick.  Personally,
I'd prefer that one like that if I were creating anything large enough to
warrant breaking the configuration down into multiple files/modules. :)

Regards,
David


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org