how can I populate notifications in dropdown in JSP

Here is the code. When I click the dropdown icon, it is empty. I want it to be loaded as soon as the page loads

ArrayList<Notifications> notifications = (ArrayList<Notifications>) session.getAttribute("notif");

  <ul class="nav navbar-nav navbar-right">

                <li class="dropdown" data-toggle="tooltip" data-placement="bottom" title="Friend Requests">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-user"></i>

                    <ul class="dropdown-menu" role="menu">

                            for(int i=0; i<notifications .size(); i++){
                            <a href="#"><%= notifications .get(i).getSender() %></a>

                        <% } %>



Source: jsp

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.