I want to set the Struts2 select
tag to a variable from the request
object instead of the action class variable.
My action class is:
public class showSchdulesAction extends ActionSupport
public String execute() throws Exception {
...
HttpServletRequest request = ServletActionContext.getRequest();
request.setAttribute("repTypList",someObj.getCommonList());
...
}
}
My JSP page:
...
<s:select onchange="genRpt(this)" list="%{repTypList}" listKey="id" listValue="val" >
</s:select>
...
I want to set the repTypeList
from the request object to select
tag.
When I used list="%{repTypList}"
or list="repTypList"
then
I got error:
tag 'select', field 'list': The requested list key '%{repTypList}' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name}
When I use list="#{repTypList}"
it's working but no value is shown in the combo options, even values in list.