Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

setting session attributes

843840Nov 9 2007 — edited Nov 9 2007
hi,
i want to set List employees into session,but i was performing this using below code i am not able to do at all .i am getting hell NULL pointer exception

can anybody help me in resolving this please .itz again urgent

Thanx in advance

below is my code


public ActionForward getEmployees(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
populateEmployees(request);
List array=(List)request.getAttribute("employees");
session.setAttribute(Constants.EMPLOYEES,array);
return mapping.findForward(Constants.SUCCESS);
}

private void populateEmployees(HttpServletRequest request) {
List employees = empService.getAllEmployees();
request.setAttribute(Constants.EMPLOYEES, employees);

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2007
Added on Nov 9 2007
2 comments
333 views