Hi Everyone,
I have been working on this prbm for the past 2 day2... I am totally lost. I know there were some posts regd the same prbm. I went thro' them but fail to find out where I am making the mistake.
PLEASE HELP ... Thanks a ton in advance...
The Error:
~~~~~~~~~~
9:06:40,633 ERROR [[action]] Servlet.service() for
servlet action threw exception
javax.servlet.jsp.JspException: Failed to obtain specified collection
at org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollectionTag.java:181)
ActionForm Contains (LeadFlowAnalysisReportForm):
~~~~~~~~~~~~~~~~~~~~
private Collection companies;
private
String compId;
private String compName;
public Collection getCompanies() {
return companies;
}
public void setCompanies(Collection companies) {
this.companies = companies;
}
public String getCompId() {
return compId;
}
public void setCompId(String compId) {
this.compId = compId;
}
public String getCompName() {
return compName;
}
public void setCompName(String compName) {
this.compName = compName;
}
Action Class contains (This returns values correctly from DAO):
~~~~~~~~~~~~~~~~~~~~~~
LeadFlowAnalysisReportForm leadFlowAnalysisRptFrm = (LeadFlowAnalysisReportForm)actionForm;
WebDelegate webDelegate = serviceLocator.getWebDelegate();
List companies = webDelegate.findAllCompanies();
log.debug("Got the company values from Hibernate. Setting it to Form");
leadFlowAnalysisRptFrm.setCompanies(companies);
JSP Contains:
~~~~~~~~~~~~~
<td><html:select property="companySearchId" style="width:165px;">
<html
ptionsCollection property="companies" label="compId" value="compName" />
</html:select></td>
VO Contains:
~~~~~~~~~~~~
public class CompanyGeneralConfigVO
{
String compId;
String compName;
public String getCompId() {
return compId;
}
public void setCompId(String compId) {
this.compId = compId;
}
public String getCompName() {
return compName;
}
public void setCompName(String compName) {
this.compName = compName;
}
}