{
HttpSession session = request.getSession(true);
com.centraview.common.UserObject userobjectd = (com.centraview.common.UserObject) session.getAttribute(
"userobject");
int individualID = userobjectd.getIndividualID();
ListPreference listpreference = userobjectd.getListPreference("Event");
//System.out.println("[DEBUG] [EventListHandler]: listpreference " +
//listpreference);
EventList displaylistSession = null;
EventList displaylist = null;
// After performing the logic in the DeleteHanlder, we are generat a new request for the list
// So we will not be carrying the old error. So that we will try to collect the error from the Session variable
// Then destory it after getting the Session value
if (session.getAttribute("listErrorMessage") != null)
{
ActionErrors allErrors = (ActionErrors) session.getAttribute("listErrorMessage");
saveErrors(request, allErrors);
session.removeAttribute("listErrorMessage");
}//end of if (session.getAttribute("listErrorMessage") != null)
try
{
displaylistSession = (EventList) session.getAttribute("displaylist");
}
catch (ClassCastException e)
{
displaylistSession = null;
//System.out.println("[DEBUG] [EventListHandler]: ClassCastException in displaylistSession.");
}
try
{
displaylist = (EventList) request.getAttribute("displaylist");
}
catch (ClassCastException e)
{
displaylist = null;
//System.out.println("[DEBUG] [EventListHandler]: ClassCastException in displaylist.");
}
EventList DL = null;
if (displaylist == null)
{
//System.out.println("[DEBUG] [EventListHandler]: displaylist was null.");
com.centraview.common.ListGenerator lg = com.centraview.common.ListGenerator.getListGenerator(dataSource);
int records = listpreference.getRecordsPerPage();
String sortelement = listpreference.getSortElement();
DL = (EventList) lg.getEventList(individualID, 1, records, "", sortelement);
//System.out.println("[DEBUG] [EventListHandler]: List Size " + DL.size());
createdNewList = true;
}