This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

cannot find BEAN in any scope

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting the error the following error while deploying struts application .can any one tell where to look in? to find the error


:Cannot find bean org.apache.struts.taglib.html.BEAN in any scope
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This error is frequently encountered in a Struts application. In order for us to help you with it, we need you to post:

1-The JSP you were trying to display when the error occurred
2-The ActionForm bean used by the JSP
3-The entries for the Action and ActionForm in your struts-config.xml file.
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I too having the same problem

My Jsp:

<BODY>
<center>
<h1> Account Control </h1>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<html:form action="/AccountMod.do">
<bean:write name="accountFormBean" property="warning" filter="false" />
Email
<html:text property="email" />
Password
<html:text property="password" />
<table>
<tr>
<td><html:radio property="operation" value="createAccount" />Create Account</td>
<td><html:radio property="operation" value="modifyAccount" />Modify Account</td>
<td><html:radio property="operation" value="deleteAccount" />Delete Account</td>
</tr>
</table>
<html:submit value="Perform Selected Operation" />
</html:form>
</center>
</BODY>

ActionForm:

package com.sunesh.struts;

import org.apache.struts.action.*;

public class AccountFormBean extends ActionForm
{
private String email = "sample@xyz.com";
private String password = "null";

//for error messages
private String warning = "";

public String getEmail()
{
return this.email;
}

public void setEmail(String email)
{
this.email = email;
}

public String getPassword()
{
return this.password;
}

public void setPassword(String password)
{
this.password = password;
}

public String getWarning()
{
return this.warning;
}

public void setWarning(String warning)
{
this.warning = "<H2>Invalid or missing <FONT color=red>" + warning + "</FONT></H2>";
}
}

struts-comfig.xml :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
<struts-config>
<form-beans>
<form-bean name="accountFormBean"
type="com.sunesh.struts.AccountFormBean" />
</form-beans>

<action-mappings>
<action path="/AccountMod"
type="com.sunesh.struts.AccountAction"
name="accountFormBean"
parameter="operation"
scope="session">

<forward name="create-success" path="admin/create-confirm.jsp" />
<forward name="create-failure" path="accountMod.jsp" />
</action>

</action-mappings>
</struts-config>


can u please help me..

Bye
 
Sunesh Kumar
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Sorry I forgot to say this..

First i am trying for only "createAccount" operation only.

But I cant even able to display the "accountMod.jsp" file

could you please help me...

Bye
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sunesh,

You need to add an "operation" property to your AccountFormBean class with a corresponding getter and setter. Also, it's a good idea to change:

<html:form action="/AccountMod.do">

to

<html:form action="/AccountMod">
 
That is a really big piece of pie for such a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic