I have two select tag country & languages.
so i have taken 2 select tag()
Now i want to achieve following things:
1] On jsp page i am writing JSP scriptlet to fetch list of countries
so i want to set the list values to country select box
2] When i select particular country i want to populate that country languages dynamically
3] I want to achieve this using struts2 tag as if i use normal html tag instead of struts2 tag then validation going to fail for that field.
So please help me how to do this?
Thanks in advance.
One of the most common idea came to my mind is using Ajax.If you want to work less than Struts2 has JQuery plugin and that will be able to do what you are looking, but i will suggest you to go with plain JQuery option.
Other option is to use plain JQuery with the help of Struts2 JSon plugin.When user select a value from the first drop down send the value to your action class using Ajax and JQuery and based on that send back the JSON data, use JQuery build in capabilities to parse JSON data and fill the second dependent drop down.