¿Cómo puedo usar i18n en un cuadro combinado usando struts2?
Frecuentes
Visto 516 veces
1
I have a form with a combobox to allow people select if they are a male or female. I want to change Hombre y Mujer for the same words in other language.
My actual combobox is:
<s:combobox readonly="true" key="sex"
list="{'Male', 'Female'}" value="Male" />
Is there a way to put this combobox in different languages?
1 Respuestas
0
Finally, I found the solution. I have to implement an action that shows this jsp page with a list in its attributes and a getter.
public class Action extends ActionSupport {
...
private List<String> genders = new ArrayList<String> ();
public Action ()
{
genders.add(getText("male"));
genders.add(getText("female"));
}
@Override
public String input() throws Exception {
return NONE;
}
...
}
Then in the jsp page, I use this attribute as the list needed in the combobox.
<s:combobox readonly="true" key="generos" list="genders"/>
contestado el 07 de mayo de 12 a las 08:05
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas forms jsp internationalization combobox struts2 or haz tu propia pregunta.