struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@gmail.com>
Subject Re: mapping.setInput()
Date Tue, 27 Jul 2004 17:23:49 GMT
On Tue, 27 Jul 2004 11:34:48 +0530, Raghuram Kanadam
<suryaprakash_kanadam@infosys.com> wrote:
> Sory Satish! Configurations freeze upon loading! Check the ActionServlet's code. However
We did find a way through, If you dont specify the input parameter then the ActionConfig.getInput
() returns a new ForwardConfig (Unfrozen)!! Use this. But I would not beleive this is good
design, for that was not the intent. You could override the initModuleConfigMethods () to
create a new Actionmapping of you own for the purpose but...!
> 
> :)

Note that there is a very good reason the configuration objects are
frozen ... they are shared by all users.  If you were allowed to
change, say, a ForwardConfig (as is being proposed here) on the fly,
you would be affecting *all* users of your application that are using
that particuar forward at the same time, not just one user.

Creating a new ForwardConfig object is the way to go for this
particular need ... just be aware that, the more you do this sort of
thing, the more knowledge about the overall organization of your
application is being spread around your Actions, instead of being
centraized in the struts-config.xml file.  You might want to at least
add some comments to struts-config.xml to point your future developers
back at the actions that are affected if you ever decide to change the
organization of forwards in the future -- Murphy's Law guarantees, of
course, that you'll pick ones like this and cause bugs :-).

Craig

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


Mime
View raw message