struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: I am getting frustrated with LookupDispatchAction
Date Wed, 19 Oct 2005 20:42:22 GMT
Michael Jouravlev on 19/10/05 00:44, wrote:
> On 10/18/05, Adam Hardy <ahardy.struts@cyberspaceroad.com> wrote:
>>Secondly, getKeyMethodMap() looks really clunky - is there no way this
>>can be pushed into the struts-config.xml?
> 
> 
> It can be done, but if this to be defined inside existing structures
> like <action>, then I would have to change Struts code. Another way is
> to define it somewhere else like <component> instead of <action> or
> just <action-events>, in this case you would need to include custom
> ruleset object into web.xml. The latter would be easier because Struts
> code would not be changed.
> 
> I will think about moving map to config file, but frankly I do not
> consider it a priority. Why you don't like it in the class file? 

Because it's just a strings that go in a map. It's more easily readable 
in a config file and it keeps them all in one place instead of having to 
open each action. Obviously that only counts when you are looking at a 
big project, but it does make an impact.

However I just thought of a better idea. Impose a rule that the name of 
the Action method should be prefixed by the prefix and that should be 
used as the name of each submit button. If the map is initialised at 
construction by reflection, it would make it all more intuitive and 
easier to code, with the added advantage that you would have one less 
place where the programmer would make a mistake.


Adam

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


Mime
View raw message