• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot find bean: " in any scope

 
Pradeep
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic