hi everyone,
I have a problem that has consumed some of my time for a while now and still not solved. I am getting an error " Cannot find bean coursesList in any scope" to be specific. I have checked some of the suggestions on the web and did not work for me. So can anyone please look at this and respond. Thank you.
part of my
JSP:
<table width="700"
border="0" cellspacing="0" cellpadding="0">
<tr align="left">
<th><bean:message key="app.course_code" /></th>
<th><bean:message key="app.section_code" /></th>
<th><bean:message key="app.year" /></th>
<th><bean:message key="app.quarter" /></th>
<th><bean:message key="app.instructor_id" /></th>
</tr>
<logic:iterate id="courses" name="coursesList">
<tr align="left">
<td>
<bean:write name="courses" property="courseCode" />
</td>
<td>
<bean:write name="courses" property="sectionCode" />
</td>
<td>
<bean:write name="courses" property="year" />
</td>
<td>
<bean:write name="courses" property="quarter" />
</td>
<td>
<bean:write name="courses" property="instructorId" />
</td>
</tr>
</logic:iterate>
my
java file:
public class CoursesListAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
String target = new String("success");
ArrayList coursesList =null;
try{
coursesList = StudentDAO.getCoursesList(getDataSource(request));
request.setAttribute("coursesList",coursesList);
}
catch (Exception e)
{
System.err.println ("CoursesListAction: Error creating a coursesList or reading from the form");
e.printStackTrace();
}
return (mapping.findForward(target));
}
in my struts-config.xml I have:
...
<action path="/CoursesList"
type="com.rit.CoursesListAction"
scope="session" >
<forward name="success" path="/CoursesQuarter.jsp" redirect="false"/>
</action>
...
now when i execute this I get the error below :
javax.servlet.ServletException: Cannot find bean coursesList in any scope
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.CoursesQuarter_jsp._jspService(CoursesQuarter_jsp.java:206)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
......
can anyone please hint me where i am going wrong?
Thank you in advance.
lee