title: Servlet to JSP certain element in ArrayList
body: <p>Im trying pass specific element from my Model to servlet to jsp. 
  This is working in my servlet: <code>System.out.println(beanModel.getSortedDomainList().get(0).split(";")[1])</code> When I go to <a href="http://localhost:8080/Comparebet/Controller" rel="nofollow">http://localhost:8080/Comparebet/Controller</a> 
  But I dont know what Im doing wrong since I dont get it to my jsp. All tutorials ive been watching is mostly input parameters or they put code in the JSP.</p>
  
  <p><strong>UPDATE EDIT</strong>
  Tried with this in my JSP and I get "null"</p>
  
  <pre><code>&lt;%= request.getAttribute("rank1") %&gt;
  </code></pre>
  
  <p><strong>SERVLET</strong></p>
  
  <pre><code>  @WebServlet("/Controller")
  public class Controller extends HttpServlet {
  
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          // ArrayList&lt;String&gt; sortedDomainList = new BeanModel().getSortedDomainList();
  
  
          BeanModel beanModel = new BeanModel();
          request.setAttribute("rank1", beanModel.getSortedDomainList().get(0).split(";")[1]);
  
          RequestDispatcher view = request.getRequestDispatcher("view.jsp");
          view.forward(request, response);
  
          //TESTING SERVLET
          System.out.println(beanModel.getSortedDomainList().get(0).split(";")[1]);
          System.out.println("CONTROLLER CALLED");
         // System.out.println(${rank1});
      }
  
       public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
  
      }
  }
  </code></pre>
  
  <p><strong>JSP</strong></p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;CompareBet&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="/Controller/*" method="get"&gt;
  
  &lt;h1&gt;${rank1.getSortedDomainList().get(0).split(";")[1] } &lt;/h1&gt;
  
   &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>