Joe Hertz wrote:

Now I've also got some screens that need input criteria for the search
that results in the data upon the screen. I'm contemplating adding a Map
to this form for this purpose.

My intentions are good. Any thoughts about where this road I am paving
is going to?

I try to keep my form beans only responsible for collecting user inputted data (the exception is I often keep the parameter used for my dispatch actions in the form bean as well). I tend to not like to bloat an ActionForm with things like Lists or Maps that are used solely for the purpose of display data used for collecting input. I 'think' what you are saying in the above is that you'd have a Map in your form bean that would be used to provide a drop down list (or something similar). I usually opt for putting stuff like this in the session or, depending on whether form validation is needed or not, you could simply make the call to the business layer to return this Map each time and populate in request scope. If you need the Map around for the life time of the user's session set in there or put it in request scope each time.


The 'road you are paving' isn't really all that bad in my opinion, but to me Action Forms shouldn't hold this kind of info. After all at some point you are having to call a business class in your action in order to populate the Action Form Map or List (a definite no-no is having the form bean actually make model layer calls to populate the Map or List). Since after getting the List or Map from the model it's just as easy to put in Session or Request scope as it is to put it in the form bean. Plus, for you plan to work it would appear the form bean would always have to have session scope, otherwise you'd still be making a model layer call to get the List or Map and then populate the form bean each time. Sometimes my form beans make sense to be in Session scope but most of the time request scope will work fine.


-- Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to