aspose file tools*
The moose likes Struts and the fly likes  Cannot find bean: 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
Author

Cannot find bean: " in any scope

Pradeep
Ranch Hand

Joined: Sep 19, 2006
Posts: 49
i got following error

javax.servlet.ServletException: Cannot find bean: "displaySharesToFundForm" in any scope




and my action class is


public class DisplaySharesToFundAction extends AbstractBaseAction{

public ActionForward process(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Throwable{
DisplaySharesToFundForm displaySharesToFundForm = (DisplaySharesToFundForm)form;
SharesToFundValidationHelper sharesToFundValidationHelper = new SharesToFundValidationHelper();
HttpSession session = request.getSession(false);


ArrayList shareTypeList = (ArrayList)TypeCodeTableHelper.getInstance().getTypeCodeList(KMSConstants.SHARE_TYPE);;
displaySharesToFundForm.setShareTypeList(shareTypeList);

ArrayList currencyList = (ArrayList)TypeCodeTableHelper.getInstance().getTypeCodeList(KMSConstants.BASE_CURRENCY);;
displaySharesToFundForm.setCurrencyList(currencyList);

session.setAttribute("CurrencyList",displaySharesToFundForm .getCurrencyList());
session.setAttribute("ShareTypeList",displaySharesToFundForm .getShareTypeList());

return null;
}
}

please help

thanks in advance
sridhar ravi
Greenhorn

Joined: Aug 24, 2006
Posts: 3
Hi,

Check whether displaySharesToFundForm this name is matched with struts-config.xml entry i both

<form-bean> and <action-mapping>

if it is ok then check in jsp

<form > tag whether name is mentioned and type is pointing to the form name path.

Thank & Regards
Ravi.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This message is being thrown by Struts as it's trying to process your JSP. It's saying you've referred to a bean named displaySharesToFundForm that doesn't exist. Struts will only instantiate the bean associated with the action. So, if you have an html:form tag with action="myAction", when you define the mapping for "myAction", you must specify "displaySharesToFundForm" as the name associated with that action.

If you still can't find the problem, show us your JSP, and the relevant portions of your struts-config.xml file. Showing us the code in your Action class doesn't help.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot find bean: " in any scope
 
Similar Threads
not linking to other jsp page
Cannot find bean: "EMPLOYEELIST" in any scope
Cannot find bean coursesList in any scope
Cannot find bean in any scope - Problems
logic:iterate