wood burning stoves 2.0*
The moose likes Struts and the fly likes Cannot Find bean under name productInfo in jsp struts 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 under name productInfo in jsp struts" Watch "Cannot Find bean under name productInfo in jsp struts" New topic
Author

Cannot Find bean under name productInfo in jsp struts

Santhosh KumarS
Greenhorn

Joined: Feb 14, 2007
Posts: 1
Hi Forum,

Im doing a project using struts and jsp in eclipse.
My problem is, i have two select box(Combo box), if i select a data i.e clientName from second select box, corresponding productName

should be displayed in first select box..

Here for me, second select box is working properly but the problem is with the first select box, im getting following errors..

<CODE>
org.apache.jasper.JasperException: Cannot find bean under name productInfo
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
</CODE>
Root Cause:<CODE>
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:843)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:776)
org.apache.jsp.pages.output_jsp._jspService(output_jsp.java:745)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
</CODE>
Root Cause:<CODE>
org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:364)
org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:186)<br>
org.apache.jsp.pages.output_jsp._jspx_meth_html_options_0(output_jsp.java:958)
org.apache.jsp.pages.output_jsp._jspx_meth_html_select_0(output_jsp.java:926)
org.apache.jsp.pages.output_jsp._jspService(output_jsp.java:296)
</CODE>
<QUOTE>What i am doing in my program is, as you see below my code,

When the user selects the clientName from second select box, i am dispatching a message named "select" from the

"TourokuAction.java". Then map.findForward function forwards to SetTourokuAction.java..
In SetTourokuAction.java i have written the code to get the data from the database and i have set the attribute Arraylist

productInfo, which has the data in session scope.And one more thing there is no problem in fetching the data from the database

into productInfo arraylist. </QUOTE>
<QUOTE>
I dont understand where i am doing wrong..please help me...
Thanks in advance..

</QUOTE>

<CODE>
-----TourokuAction.java-----
return map.findForward((String)tForm.getDispatch());


-----SetTourokuAction.java-----

ArrayList productInfo = new ArrayList();
if(ProIdYear != null){
productInfo = bService.getProductName(ProIdYear);
}

session.setAttribute("productInfo", productInfo);


-----output.jsp-----
(First Selectbox: to select the productName)

<html:select property="projectSelection" style="WIDTH: 290px;" onklick="copyText()" onshange="copyText()" >
<html ptions collection="productInfo" property="productClass" labelProperty ="productName" />
</html:select>


(Second SelectBox: to select the clientName)

<html:select property="clientName1" style="WIDTH: 170px;" onshange=document.forms[0].projectSelection[0].selected='1';

document.forms['TourokuForm'].dispatch.value='select';document.forms[0].submit();" >
<html ptions collection="clientInfo" property="clientId" labelProperty="description"/>
</html:select>



-----struts-config.xml-----

<action path="/TourokuAction" type="login.web.action.TourokuAction"
name="TourokuForm" scope="session" input = "/pages/output.jsp">
<forward name="select" path="/select.do" />
<forward name="success" path="/pages/success.jsp" redirect = "false" />
<forward name="failure" path="/pages/Failure.jsp" redirect = "false" />
</action>

<action path="/select" type="login.web.action.SetTourokuAction"
name="TourokuForm" scope="request" validate="true" input = "/pages/output.jsp">
<forward name="success" path="/pages/output.jsp" redirect = "false" />
<forward name="failure" path="/pages/Failure.jsp" redirect = "false" />
</action>

</CODE>
 
 
subject: Cannot Find bean under name productInfo in jsp struts
 
Similar Threads
Issue in Struts Dropdown(Need Help Ranchers)
html:options throws error due to labelProperty attribute
How to Pass Parameter from .java to struts-config.xml to .jsp
document.form.action problem
Dynamic Dropdowns