Greetings,

I am new to Struts list
I am getting an exception with the message "No bean found under attribute key 
customerForm" when I am accessing the JSP where in which I am using the logic:equal 
tag. I am using this tag to check whether a formbean variable (called action) value is 
equal to "new" or not.
I have configured the formbean with the name customerForm in the config file. and I am 
sure that the bean is in classpath.
I am in need of the corrective action to solve the problem
The following are the details..

Thanks,
Satya
----------------

I have written an Action Form class called org.ig.shopone.web.CustomerForm that is 
having following 6 fields with public getter and setter methods (along with validate 
and reset methods).. 

    private String name;
    private String address;
    private String customerId;
    private String password;
    private String password2;
    private String action;

I am using the above Form in a JSP to check whether the action field value is "new" or 
"edit".

<html:html>
<head>
    <logic:equal name="customerForm" property="action" scope="request" value="new">
        <title><bean:message key="customer.new.title"/></title>
    </logic:equal>
    <logic:notEqual name="customerForm" property="action" scope="request" value="new">
        <title><bean:message key="customer.edit.title"/></title>
    </logic:notEqual>
    <html:base/>
</head>
<body bgcolor="white">
    <html:errors/>
...
..
When I am executing the above JSP file I am getting the following Exception

--------------------------------------------------------------------------------------------------------------
HTTP Status 500 - 
type Exception report

message 

description The server encountered an internal error () that prevented it from 
fulfilling this request.

exception 

org.apache.jasper.JasperException: No bean found under attribute key customerForm
void 
org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpServletRequest,
 javax.servlet.http.HttpServletResponse, boolean)
JspServletWrapper.java:248
void 
org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest,
 javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, 
boolean)
JspServlet.java:289
void 
org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletRequest, 
javax.servlet.http.HttpServletResponse)
JspServlet.java:240
...........
....
--------------------------------------------------------------------------------------------------------------

The following is the configuration file 

<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts 
Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>
<struts-config>
    <form-beans>
        <form-bean name="customerForm" type="org.ig.shopone.web.CustomerForm"/>
    </form-beans>
    <action-mappings>
        <action path="/customer" type="org.ig.shopone.web.actions.CustomerAction" 
name="customerForm" scope="request"/>
    </action-mappings>
    <message-resources parameter="ApplicationResources"/>
</struts-config>

--------------------------------------------------------------------------------------------------------------

Reply via email to