Hi:
I am getting a NULL pointer with the request object: Please see code below.
I got a NULL pointer trying to access "vehList' in the request object inside
the method "prepareListForUpdate". But I didn't get a NULL pointer
accessing "vehList" inside the method "setScheduleList".
So it looks like the 1st time it ran through the Action class, the request
object is ther. But the 2nd time it ran through the Action class, either
the request object is null or "vehList' is no longer in the request object.
===============================
Portion of Action class:
ArrayList vehList = new ArrayList();
==> initialize and set values for vehList here <====
if (formBean.isSearchAction()) // user clicks 'search' on form. Run
through this Action class the 1st time
{
request.setAttribute("vehList",vehList);
this.setScheduleList(request); // invoke another method
<=== eventually "first.jsp" with an 'Update" button is displayed
}
else if (formBean.isBlnUpdateAction()) // user clicks 'update' in
"first.jsp", Run through this Action class the 2nd time
{
this.prepareListForUpdate(request); // invoke another method
}
=============================
Portion of method "setScheduleList":
setScheduleList(javax.servlet.http.HttpServletRequest request)
{
// display vehList.size() AND IT PRINTED OUT OK
ArrayList l = (ArrayList) request.getAttribute("vehList");
EtLog.debug(this,"in setScheduleList, vehList,size()="+l.size());
}
==================================
Portion of method "prepareListForUpdate":
prepareListForUpdate(javax.servlet.http.HttpServletRequest request)
{
// display vehList.size() AND IT GAVE ME A NULL POINTER EXCEPTION
ArrayList l = (ArrayList) request.getAttribute("vehList");
EtLog.debug(this,"in prepareListForUpdate,
vehList,size()="+l.size());
}
====================================
Any help will be appreciated,
Newbie
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]