• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot find bean in any scope

 
anjali gosain
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I m new to struts and i m struck with this error... I have to create a link which passes a parameter to the bean. but all i get is the error:

exception

javax.servlet.ServletException: Cannot find bean dataForm in any scope
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:85)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

javax.servlet.jsp.JspException: Cannot find bean dataForm in any scope
org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:992)
org.apache.struts.taglib.TagUtils.computeParameters(TagUtils.java:206)
org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:442)
org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:334)
org.apache.jsp.index_jsp._jspx_meth_html_link_0(org.apache.jsp.index_jsp:196)
org.apache.jsp.index_jsp._jspx_meth_html_html_0(org.apache.jsp.index_jsp:119)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


here is the line from index.jsp

<html:link action="Data" paramId="report" paramProperty="report" paramName="dataForm"> Click here </html:link>


and struts-sonfig.xml

<form-bean name="dataForm"
type="ch02.DataForm"/>

<action
path="/Data"
type="ch02.DataAction"
name="dataForm"
scope="request"
input="/index.jsp">
<forward name="success" path="/results.jsp"/>
<forward name="failure" path="/index.jsp"/>
</action>


the class DataForm and DataAction are present in WEB-INF\classes\ch02 folder

can somone plz help me sort this out...

thanks in advance
 
anjali gosain
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey i managed to solve it out
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic