File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes    cannot find BEAN in any scope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "   cannot find BEAN in any scope" Watch "   cannot find BEAN in any scope" New topic

cannot find BEAN in any scope

athadu pokiri

Joined: Jul 09, 2006
Posts: 5
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
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.

Consultant, Sima Solutions
Sunesh Kumar
Ranch Hand

Joined: Oct 17, 2005
Posts: 89

I too having the same problem

My Jsp:

<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="/">
<bean:write name="accountFormBean" property="warning" filter="false" />
<html:text property="email" />
<html:text property="password" />
<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>
<html:submit value="Perform Selected Operation" />


package com.sunesh.struts;

import org.apache.struts.action.*;

public class AccountFormBean extends ActionForm
private String email = "";
private String password = "null";

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

public String getEmail()

public void setEmail(String 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"
<form-bean name="accountFormBean"
type="com.sunesh.struts.AccountFormBean" />

<action path="/AccountMod"

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


can u please help me..


Thanks & Regards<br />Sunesh Kumar Baachu
Sunesh Kumar
Ranch Hand

Joined: Oct 17, 2005
Posts: 89

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...

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864

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="/">


<html:form action="/AccountMod">
I agree. Here's the link:
subject: cannot find BEAN in any scope
It's not a secret anymore!