Struts Error: org.apache.jasper.JasperException: Cannot find bean in any scope
From: Vaidy (vaidynara_at_hotmail.com)
Date: 12/10/03
- Previous message: Anil Sharma: "Re: Applet and Application Problem - Please Help!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Dec 2003 23:45:59 -0800
I am using struts 1.1 my application. I am getting this error message
in my application:
org.apache.jasper.JasperException: Cannot find bean Enquiries in any
scope
Here is my .jsp snippet that is using "Enquiries":
<HTML:form action="/SCOrders"
name="enquiryForm"
type="erpjewel.marketing.SCEnquiryForm">
<TABLE width="650" border="0" >
<logic:iterate id="enquiry" name="enquiryList" >
<TR align="left">
<TD>
<bean:write name="enquiry" property="referenceno"
/>
</TD>
<TD>
<bean:write name="enquiry" property="scdate" />
</TD>
<TD>
<bean:write name="enquiry" property="tripno" />
</TD>
<TD>
<bean:write name="enquiry" property="agentname" />
</TD>
<TD>
<bean:write name="enquiry" property="agentcode" />
</TD>
<TD>
<bean:write name="enquiry" property="quantity" />
</TD>
<TD>
<bean:write name="enquiry" property="currencytype"
/>
</TD>
<TD>
<bean:write name="enquiry" property="sum" />
</TD>
<TD>
<bean:write name="enquiry" property="confirmed" />
</TD>
</TR>
</logic:iterate>
<TR>
<TD colspan="9">
<HR>
</TD>
</TR>
</TABLE>
</HTML:form>
The controller class has the following code that sets this attribute:
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
SCEnquiryDTO enquiry = null;
ArrayList enquiryList = null;
String target = "success";
SCEnquiryForm eForm = (SCEnquiryForm)form;
try{
if(setSCEnquiryParams(eForm, request))
enquiryList = getSCOrders(eForm);
}
catch (Exception e){
System.err.println(e.getMessage());
}
eForm.setEnquiryList(enquiryList);
request.setAttribute("enquiryList", enquiryList);
return (mapping.findForward(target));
}
and struts-config has
<!-- ========== Form Bean Definitions ================= -->
<form-beans>
<form-bean name="enquiryForm"
type="erpjewel.marketing.SCEnquiryForm"/>
</form-beans>
<!-- ========== Action Mapping Definitions ============ -->
<action-mappings>
<action path="/SCOrders"
type="erpjewel.marketing.SCEnquiryAction"
name="enquiryForm"
scope="request">
</action>
</action-mappings>
following is the web.xml:
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>erpjewel.marketing.ApplicationResources</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
</web-app>
Here I am not sure if my configuration in struts-config is correct?
Execute method is properly impelement? Or if Employees bean is empty?
Please help.
Regards
Vaidy
- Previous message: Anil Sharma: "Re: Applet and Application Problem - Please Help!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]