Hi All,

I need urgent help on this!
help greatly appreciated..been stuck on this for a LONG time!
it is not able to locate conditionList

Servlet.service() for servlet jsp threw exception
tag 'select', field 'list', name 'bookCondition': The requested list key 
'conditionList' could not be resolved as a 
collection/array/map/enumeration/iterator type


register.jsp

<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
<title>Struts 2 Insert Data Application!</title>
</head>
<body>
<s:form action="Register" method="POST" validate="false">
<s:select
name="bookCondition" list="conditionList" headerKey="0" headerValue="--
Select Book Condition" label="Condition" />
<s:submit value="Save" align="center"/>
</s:form>
</body>
</html>

RegisterAction.java
package BookRez.Database;

import java.util.ArrayList;

import com.opensymphony.xwork2.ActionSupport;

public class RegisterAction extends ActionSupport {
   
    private ArrayList<String> conditionList;

    public String populate() {
        conditionList = new ArrayList<String>();
        conditionList.add("Like New");
        conditionList.add("Very Good");
        conditionList.add("Good");
        conditionList.add("Acceptable");
        return "populate";
    }

    public String execute() {
        return SUCCESS;
    }

    public ArrayList<String> getConditionList() {
        return conditionList;
    }

    public void setCountryList(ArrayList<String> conditionList) {
        this.conditionList = conditionList;
    }
}

struts.xml
<struts>
    <package name="BookRez" extends="struts-default">
<action name="*Register" method="{1}" class="BookRez.Database.RegisterAction">
                <result name="populate">/register.jsp</result>
                <result name="input">/register.jsp</result>
                <result name="success">/success.jsp</result>
        </action>
    </package>
</struts> 
                                          

Reply via email to