jsp - How to populate data from servlet to dropdown -


I have a servlet where I've come back a list:

  protected void doGet ( HttpServletRequest request, HTTPServlet Response Response) Servlet Upgrade, IOException throws {doPost (request, response); } / ** * @see HttpServlet # doPost (HttpServletRequest request, HttpServletResponse response) * / protected void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {println ( "The role of management DoPost inside ---"); This.context = request.getServletContext (); UserProperties userProp; Try {UserProp = new UserProperties (); // just a place holder can be read that the property file to view it ... userGroup_DS_Proxy = userProp.ReadProperties ( "UserGroup_DS_Proxy"). ToString (); System.out.println ("Properties file location found in th the Tomcat folder"); } Hold (exception preceding) {userProp = new UserProperties (reference); System.out.println ("Failed Mode Active"); } UserGroup_DS_Proxy = userProp.ReadProperties ("UserGroup_DS_Proxy"). ToString (); Rolemngementdebug = Buliankvluao (Usserpropkradproperthys ( "Rolemngementdebug"). Tostring ()); RoleManagementDAO roleManagementDAO = New RoleManagementDAO (roleManagementDebug, userGroup_DS_Proxy); If (roleManagementDebug) {System.out.println ("new post for role management"); } List & lt; String & gt; Roles = RoleManagementAd.O.Gaterol (); Http session session = request.getSession (true); Session.setAttribute ("RoleList", roles); }  

Now I as determined in HttpSession I am going through the list: session.setAttribute ( "RoleList", roles);

Now I want to get the value of this session in jsp and want to populate a dropdown with this session variable. Since I do not have much knowledge of the JSP side, so to solve this problem, I am really having trouble, how can I do this? Your responses are leading to%; You can use the JSTL tag and display the list (instead of & lt instead of trying with the scriptlet) "Text" itemprop = "text">

Thank you%>) In his header jsp,

  & lt;% @ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core"% & gt ;  

You can check for information

   & Lt; / Options & gt; & Lt; / C: foreach & gt;  

Hope it helps.


Comments