On Mon, Mar 3, 2008 at 5:37 PM, Martin Gainty <[EMAIL PROTECTED]> wrote:
> construct a public Map in your Action class and insert the key,value
> pairings e.g.
> public Map getDefaultFavouriteCartoonCharacters() {
> Map m = new LinkedHashMap();
> m.put("heMan", "He-Man");
> m.put("popeye", "Popeye");
> m.put("mockeyMouse", "Mickey Mouse");
> return m;
> }
>
> and reference the public Map via list attribute in your jsp
> <s:select
> list="defaultFavouriteCartoonCharacters"
> ...
> />
>
> or just use a set of hardcoded values in key:value pairings for the list
> attribute
> <s:select
> list="#{'heMan':'He-Man', 'popeye':'Popeye', [...]}"
> ..
> />
>
> Martin
>
We could define them on the actions, but since we use lists like the
list of States and Provinces, Gender List and a bunch of others all
over the place, I didn't want to have to define them everywhere.
So we created a BaseAction that defines all those lists, but now that
list is growing and theres a bunch of useless methods on every action.
I was looking for something more dynamic, and I was hoping the
<sarcasm>great and powerful OGNL</sarcasm> could help out.
I guess I'll try to write a static utility method that I can call with
the @ syntax to return a map of data and see how that flies. Thanks
for the input.
(*Chris*)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]