How do I get a list of Strings in a select from Struts2?

3

I have a select on my page that should have its value and its legend populated through a list of Strings that come from my Action.

I'm sending the list correctly because I see the combo have the number of elements of the same size as the list, but I do not know how to identify the value and description in TagLib.

<s:select name="status" list="status" headerKey="" headerValue="-- Selecione --" id="statusMedico" listKey="" listValue="" />

What should I use in listKey and listValue to populate the options?

The method in action:

public List<String> getStatus() {
    return Arrays.asList("Ativo", "Inativo");
}
    
asked by anonymous 14.02.2014 / 22:31

1 answer

2

The answer to this question is to get the attributes listKey and listValue .

Source: link

    
17.02.2014 / 15:19