I have an requirement where I have to populate multiple number of dropdowns with values which will be fetched from database. I am using struts2 framework and calling a json action which return json type.But the problem here is for each and every dropdown I had to write a separate action which is causing many different calls to DB.
Is it possible to do this in one single json action call so that all the required values can be fetched using one json action only and values will be populated in dropdowns accordingly.
Currently what I am doing looks like this which is working fine but I am looking for a solution(if there exists one) where we will not need these many <s:url/>
calls.
<s:url var="fillA" action="fillA" />
<sj:select id="dropdownA" href="%{fillA}" list="listA"/>
<s:url var="fillB" action="fillB" />
<sj:select id="dropdownB" href="%{fillB}" list="listB"/>
<s:url var="fillC" action="fillC" />
<sj:select id="dropdownC" href="%{fillC}" list="listC"/>