Here what I am going to do is I want to display existign users in database in Drop-down menu, for this i have written class file to connect to database ,one more class file to perform database queries and one servlet for calling method which i have retrived an stored in arraList, and then i have written jsp(using JSTL) file to display the users in drop-down menu,but my JSP file is not showing any user and these are the code i have written
and finally user.jsp
guys please help me and thanks in advance
What problem do you have? What are you doing in line 39 in the Servlet? You are overwritting the ArrayList with the session element!
You cannot access anything you want in your JSP, you have to access scoped attributes, declared variables or implicit objects
srinivas miriyala wrote:thanks for you reply,My porblem is JSP file is not showing users in the drop-dwon menu and in line 39 I am retriving arraylist object from the session object and correct me if i am wrong,I tried with commenting line 39 but same problem
But do you have that ArrayList in the Session? Have you set it before? Do you have your ArrayList in any scope to be retrieved by the JSP? You have to set it in the request or in session (better in request) as an attribute in the Servlet
then in your JSP you access it:
But please, first of all look at the documentation for creating JSPs with JSTL and EL.