RE: No bean found under attribute key - any config problem?
What do u mean by executing the jsp? The way u have done configuration, there will not be any problem if u are calling the CustomerAction and the CustomerAction action is doing a forward to the jsp. BEcause then only the form bean will be available. How u are executing the jsp? -Original Message- From: satyanarayana [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 1:57 PM To: struts-user Cc: satyanarayana Subject: No bean found under attribute key - any config problem? 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 titlebean:message key=customer.new.title//title /logic:equal logic:notEqual name=customerForm property=action scope=request value=new titlebean: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.HttpServl etRequest, javax.servlet.http.HttpServletResponse, boolean) JspServletWrapper.java:248 void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServl etRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) JspServlet.java:289 void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletReque st, 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 -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: No bean found under attribute key - any config problem?
Hi, I am using Tomcat 4.1.1 I didn't configured any action forwards.. I think the main problem is with logic:equal usage I think the bean is not getting instantiated. Its working fine without any logic:equal tags in my JSP... but to add extra functionality, I have to use logic:equal tag Thanks - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, December 09, 2002 6:27 PM Subject: RE: No bean found under attribute key - any config problem? What do u mean by executing the jsp? The way u have done configuration, there will not be any problem if u are calling the CustomerAction and the CustomerAction action is doing a forward to the jsp. BEcause then only the form bean will be available. How u are executing the jsp? -Original Message- From: satyanarayana [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 1:57 PM To: struts-user Cc: satyanarayana Subject: No bean found under attribute key - any config problem? 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 titlebean:message key=customer.new.title//title /logic:equal logic:notEqual name=customerForm property=action scope=request value=new titlebean: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.HttpS ervl etRequest, javax.servlet.http.HttpServletResponse, boolean) JspServletWrapper.java:248 void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpS ervl etRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) JspServlet.java:289 void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletR eque st, 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 -- -- -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Re: No bean found under attribute key - any config problem?
No.U are not getting it right. U should understand the flow of struts for this. For the bean to get instantiated, it has to associated with some action. And from u r config file, it looks that u have mapped the form to /customer action.So if u call this customer action first, then in the action say mapping.findForward(success) and change the mapping for action as follows. action-mappings action path=/customer type=org.ig.shopone.web.actions.CustomerAction name=customerForm scope=request/ forward name=successpath=/yourjsp.jsp/ /action-mappings then this will work. If u are directly calling jsp, there is no way the form bean will be available. And the tag does not create any bean.It accesses the bean avaiblable already(generally created in action..) And it works without the logic tag is because in rest of u r page, u are not refering to any of bean attributes.i.e. form bean is not referred. regards, Shirish -Original Message- From: satyanarayana [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 2:13 PM To: struts-user Cc: satyanarayana Subject: Re: No bean found under attribute key - any config problem? Hi, I am using Tomcat 4.1.1 I didn't configured any action forwards.. I think the main problem is with logic:equal usage I think the bean is not getting instantiated. Its working fine without any logic:equal tags in my JSP... but to add extra functionality, I have to use logic:equal tag Thanks - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, December 09, 2002 6:27 PM Subject: RE: No bean found under attribute key - any config problem? What do u mean by executing the jsp? The way u have done configuration, there will not be any problem if u are calling the CustomerAction and the CustomerAction action is doing a forward to the jsp. BEcause then only the form bean will be available. How u are executing the jsp? -Original Message- From: satyanarayana [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 1:57 PM To: struts-user Cc: satyanarayana Subject: No bean found under attribute key - any config problem? 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 titlebean:message key=customer.new.title//title /logic:equal logic:notEqual name=customerForm property=action scope=request value=new titlebean: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.HttpS ervl etRequest, javax.servlet.http.HttpServletResponse, boolean) JspServletWrapper.java:248 void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpS ervl etRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) JspServlet.java:289 void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletR eque st, 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
RE: No bean found under attribute key - any config problem?
Hi Satya, From what you've included of your JSP file, it looks like the problem is that the page has no reference to the customrForm bean by the time you go to use it. The html:form.../ tag makes this bean available, but since you are using the logic tags inside your header rather than within an html:form, this bean is not available. If the action property does in fact belong in your form bean (as opposed to being its own request attribute), then you can import the form bean with a jsp:useBean.../ tag at the top of your JSP. I don't know how well jsp:useBean and html:form play together when referencing the same bean, but give it a try with something like this: jsp:useBean id=customerForm scope=request type=org.ig.shopone.web.CustomerForm/ Just put that line at the top of your JSP and see what you get. If the action property is never part of your form, then you might want to consider making it its own request attribute, populated within the Action class, and imported with a jsp:useBean tag similar to the one above. HTH, Justin -Original Message- From: Satyanarayana M [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:57 AM To: [EMAIL PROTECTED] Subject: No bean found under attribute key - any config problem? 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 titlebean:message key=customer.new.title//title /logic:equal logic:notEqual name=customerForm property=action scope=request value=new titlebean: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.serv let.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) JspServletWrapper.java:248 void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.serv let.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.htt p.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 -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: No Bean found under attribute key
Your referring to a bean of name indexPage but the only thing in the code you've shown named indexPage is a forward. This will not create a bean named indexPage - try setting up an ActionForm and doing something along the follwoing lines: logic:equal name=myForm property=action scope=request value=Display html:text property=server size=16 maxlength=16/ /logic:equal .xml form-beans form-bean name=myForm type=com..MyForm/ /form-beans actionpath=/indexPage form=myForm type=com.niku.cm.IndexPageAction forward name=success path=/index.jsp/ forward name=failure path=/nodata.jsp/ /action -Original Message- From: Rama Krishna [mailto:[EMAIL PROTECTED]] Sent: 27 June 2001 20:07 To: [EMAIL PROTECTED] Subject: No Bean found under attribute key Hi all, I am new to struts and i created a simple jsp and all along with proper modifications to struts-config.xml and when i try to run my jsp i get the above exception. Can anyone tell me what could be the cause??? here is my code .jsp logic:equal name=indexPage property=action scope=request value=Display html:text property=server size=16 maxlength=16/ /logic:equal .xml actionpath=/indexPage type=com.niku.cm.IndexPageAction forward name=success path=/index.jsp/ forward name=failure path=/nodata.jsp/ /action thanks, rama
Re: No Bean found under attribute key
In your logic:equal tag, you are using 'name' and 'property'. In your html:text tag, you are using only 'property'. The second case will work only if this code is inside an html:form tag and the form bean has a property with that name. -- Martin Cooper - Original Message - From: Rama Krishna [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 12:06 PM Subject: No Bean found under attribute key Hi all, I am new to struts and i created a simple jsp and all along with proper modifications to struts-config.xml and when i try to run my jsp i get the above exception. Can anyone tell me what could be the cause??? here is my code .jsp logic:equal name=indexPage property=action scope=request value=Display html:text property=server size=16 maxlength=16/ /logic:equal .xml actionpath=/indexPage type=com.niku.cm.IndexPageAction forward name=success path=/index.jsp/ forward name=failure path=/nodata.jsp/ /action thanks, rama
Re: No Bean found under attribute key
thanx much martin, html:form action=indexPage html:text name=indexPage property=Server / /html:form is it possible to have this one line instead of logic:equal, because it is my index page and i want to get some data from the actionclass without any form submission. and when i changed my jsp like above i am getting new error No getter method for property Server of bean indexPage but i have getServer(),setServer() inside my IndexPage class. rama. - Original Message - From: Martin Cooper [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 5:24 PM Subject: Re: No Bean found under attribute key In your logic:equal tag, you are using 'name' and 'property'. In your html:text tag, you are using only 'property'. The second case will work only if this code is inside an html:form tag and the form bean has a property with that name. -- Martin Cooper - Original Message - From: Rama Krishna [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 12:06 PM Subject: No Bean found under attribute key Hi all, I am new to struts and i created a simple jsp and all along with proper modifications to struts-config.xml and when i try to run my jsp i get the above exception. Can anyone tell me what could be the cause??? here is my code .jsp logic:equal name=indexPage property=action scope=request value=Display html:text property=server size=16 maxlength=16/ /logic:equal .xml actionpath=/indexPage type=com.niku.cm.IndexPageAction forward name=success path=/index.jsp/ forward name=failure path=/nodata.jsp/ /action thanks, rama
Re: No Bean found under attribute key
I'm not sure I understand what you're asking. You can either use: html:text name=indexPage property=server / on its own, or: html:text property=server / if it's inside a form. If you don't need a form, you don't have to use one. You are getting a no getter error because you specified the property name as Server instead of server. -- Martin Cooper - Original Message - From: Rama Krishna [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 5:43 PM Subject: Re: No Bean found under attribute key thanx much martin, html:form action=indexPage html:text name=indexPage property=Server / /html:form is it possible to have this one line instead of logic:equal, because it is my index page and i want to get some data from the actionclass without any form submission. and when i changed my jsp like above i am getting new error No getter method for property Server of bean indexPage but i have getServer(),setServer() inside my IndexPage class. rama. - Original Message - From: Martin Cooper [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 5:24 PM Subject: Re: No Bean found under attribute key In your logic:equal tag, you are using 'name' and 'property'. In your html:text tag, you are using only 'property'. The second case will work only if this code is inside an html:form tag and the form bean has a property with that name. -- Martin Cooper - Original Message - From: Rama Krishna [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 12:06 PM Subject: No Bean found under attribute key Hi all, I am new to struts and i created a simple jsp and all along with proper modifications to struts-config.xml and when i try to run my jsp i get the above exception. Can anyone tell me what could be the cause??? here is my code .jsp logic:equal name=indexPage property=action scope=request value=Display html:text property=server size=16 maxlength=16/ /logic:equal .xml actionpath=/indexPage type=com.niku.cm.IndexPageAction forward name=success path=/index.jsp/ forward name=failure path=/nodata.jsp/ /action thanks, rama