• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot find bean: " in any scope

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
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 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic