I Have a servlet where i have returned a list :
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("inside doPost of Role Management ---");
this.context = request.getServletContext();
UserProperties userProp;
try{
userProp= new UserProperties();
//just a place holder to see if the property file can be read...
userGroup_DS_Proxy = userProp.ReadProperties("UserGroup_DS_Proxy").toString();
System.out.println("Properties file location was found in th tomcat folder");
}catch(Exception ex){
userProp= new UserProperties(context);
System.out.println("Fail Safe Mode Activated");
}
userGroup_DS_Proxy = userProp.ReadProperties("UserGroup_DS_Proxy").toString();
roleManagementDebug = Boolean.valueOf(userProp.ReadProperties("RoleManagementDebug").toString());
RoleManagementDAO roleManagementDAO= new RoleManagementDAO(roleManagementDebug,userGroup_DS_Proxy);
if(roleManagementDebug){
System.out.println("new post for Role Management");
}
List<String> roles = roleManagementDAO.getRoles();
HttpSession session = request.getSession(true);
session.setAttribute("RoleList", roles);
}
Now i am passing the list by setting it in HttpSession as : session.setAttribute("RoleList", roles);
Now i want to get this session value in the jsp and populate a dropdown with this session variable. Since i don't have much knowledge of JSP side, It is getting really hard for me to solve this problem. How can i do this? Looking forward to your answers. Thanks in advance