{
HttpSession session = request.getSession(true);
session.setAttribute("highlightmodule", "email");
UserObject userobjectd = (UserObject)session.getAttribute("userobject");
ListPreference listpreference = userobjectd.getListPreference("Email");
DisplayList displaylistSession = (DisplayList)session.getAttribute("displaylist");
DisplayList displaylist = (DisplayList)request.getAttribute("displaylist");
String deleteFlag = (String)request.getAttribute("deleteFlag");
// System.out.println("displaylist"+displaylist);
// Folder List
EmailFacadeHome aa = (EmailFacadeHome)CVUtility.getHomeObject("com.centraview.email.emailfacade.EmailFacadeHome", "EmailFacade");
EmailFacade remote = (EmailFacade)aa.create();
remote.setDataSource(dataSource);
int individualID = userobjectd.getIndividualID();
FolderList fl = (FolderList)remote.getFolderList(individualID);
String[] maps = mapping.findForwards();
if (fl == null)
{
return (mapping.findForward("displaynomailaccount"));
}
else if (fl.size() == 0)
{
return (mapping.findForward("displaynomailaccount"));
}
session.setAttribute("folderlist", fl);
int folderid = fl.getDefaultFolder();
System.out.println("folderid"+folderid);
if (request.getParameter("folderid") != null)
{
folderid = Integer.parseInt(request.getParameter("folderid"));
}
if (request.getParameter("folderid") == null)
{
System.out.println("request.getAttribute(folderid)--->"+request.getAttribute("folderid"));
if(request.getAttribute("folderid") != null){
folderid = Integer.parseInt((String)request.getAttribute("folderid"));
}
}
//End Folder List
session.setAttribute("folderid", "" + folderid);
EmailList DL = null;
if (displaylist == null)
{
ListGenerator lg = ListGenerator.getListGenerator(dataSource);
DL = (EmailList)lg.getEmailList(individualID, 1, listpreference.getRecordsPerPage(), "", listpreference.getSortElement(),'D', folderid, true);
}
else
{
String searchSession = displaylistSession.getSearchString();
String searchrequest = displaylist.getSearchString();