I have problem with checkbox property not communicating with my Action. I have String property with "Y"/"N" in FormBean populated from DAO , I convert it to "yes"/"no" before sending it to form and I do conversion back from "yes"/"no" to "Y"/"N" after I receive from form and send it to DAO. What is missing here ? Pls. Help !!
In my FormBean it is String element as under public class InstrumentForm extends ActionForm { .... private String lockedFlag; .... } My jsp lines for checkbox is as follows: <td class="tdLabel"><fmt:message key="label.lockedFlag"/>:</td> <td><html:checkbox property="lockedFlag" value="${lockedFlag}"/></td> As my dao returns "Y" or "N" I do following conversion when I send data to form. public ActionForward setUpForInsertOrUpdate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { InstrumentForm instForm = (InstrumentForm)form; if (instrument.getLockedFlag().equalsIgnoreCase("Y")) { instrument.setLockedFlag("yes"); } else { instrument.setLockedFlag("no"); } BeanUtils.copyProperties(instForm, instrument); } prep(request,initMap); return mapping.findForward(Constants.SUCCESS); } On its way back from form I do following conversion public ActionForward insertOrUpdate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { InstrumentForm instForm = (InstrumentForm)form; if (instForm.getLockedFlag().equalsIgnoreCase("yes")) { instForm.setLockedFlag("Y"); } else { instForm.setLockedFlag("N"); } instService.updateInstrument(instrument); } This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries and affiliates