Hi All,
I am a beginner to
Struts. My task is to populate a list box. The values to be populated are obtained from database.
My code in
JSP looks like this
<tr class = "BodyText">
<td width = "20%" ><bean:message key= "label.transactions.6KL.costCenterNo"/></td>
<td width = "20%"><logic:notEmpty name = "CtrctTxnForm" property="listContractorNo">
<html:select name = "CtrctTxnForm" property="costCenterNo" >
<html
ption value="null" ><bean:message key="label.default.select" /></html
ption>
<html
ptionsCollection name = "CtrctTxnForm" property="listContractorNo" label="costCenterNo" value = "costCenterNo" />
</html:select>
</logic:notEmpty>
<logic:empty name="CtrctTxnForm" property="listContractorNo" >
<html:select name="CtrctTxnForm" property="costCenterNo" styleClass="POPText" >
<html
ption value="null"><bean:message key="label.default.select" /></html
ption>
</html:select>
</logic:empty>
</td>
</tr>
And the action is defined in struts-config.xml as follows :
<actionpath="/Ctrct6KL"
input = "/jsp/Contract/Ctrct6KL_Search.jsp"
type= "com.transactions.actions.CtrctAction"
name = "CtrctTxnForm"
scope = "session" >
<forward name="fail" path="/jsp/Contract/Ctrct6KL_Search.jsp" />
</action>
I get the following message when I try accessing the JSP:
No getter method found for property costCenterNo.
However I do have a form named CtrctTxnForm where in I have getter and setter method for property costCenterNo.
Guys please help me where am I going wrong.
Regards
Nikhil Bansal