You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Karl <ka...@webartjapan.com> on 2003/03/17 08:48:31 UTC

ServletException: Cannot find bean element in scope null

I'm getting an exception [ServletException: Cannot find bean element in scope 
null] when I try to access form data from a jsp page.

I've got the following code in my action class:

public final class ContractsSearchAction extends ContractBaseAction {

    public ActionForward perform(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {

        ContractForm workForm = (ContractForm)form;

        ContractsSearchCommand cmd = new ContractsSearchCommand();
        // Would do some setting here for criteria from workForm
        cmd.execute();

        ContractListForm outForm = new ContractListForm();
        outForm.setContracts(cmd.getContracts());

        request.setAttribute("contractListForm", outForm);
		
        return (mapping.findForward("results"));
    }
}


The JSP page it goes to has the following:

                <logic:iterate id="element" name="contractListForm" 
property="contracts" type="data.ContractBDO">
                    <tr>
                        <td>
                            <bean:write name="element" property="fullName"/>
                        </td>
                        <td class="button">
                            <html:form action="contract_select.do" 
name="contractForm" type="view.ContractForm">
                                <html:hidden name="element" property="id"/>
                                <html:submit value="Edit"/>
                            </html:form>
                        </td>
                    </tr>
                </logic:iterate>


The exception is:

javax.servlet.ServletException: Cannot find bean element in scope null
        at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:530)
        at 
org.apache.jsp.contracts_list_jsp._jspService(contracts_list_jsp.java:71)
... and so on


What am I doing wrong here?


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org