title: I don't see the data submitted after I refresh the page one or two times : how does the ArrayList get empty on its own?
body: <p>I have to submit some links via the control panel of a website and they should automatically appear in the jsp page,next time the user refreshes it.To do this,I click the submit button after pasting the link,a post request is generated and servlet handles that link by calling a bean's function from itself and stores the link there in the ArrayList.</p>
  
  <p><em>snippet from servlet</em></p>
  
  <pre><code>   protected void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
     String link = request.getParameter("song link");
     StoreSongLink store = new StoreSongLink(); // A Bean class
     int ret = store.storeSongLink(link); // calls the bean method
     // if ret is 0,return to the cpanel home page
  </code></pre>
  
  <p><em>Bean class</em></p>
  
  <pre><code>public class StoreSongLink {
  public static ArrayList&lt;String&gt; linkList = new ArrayList&lt;String&gt;();
  
   public int storeSongLink(String link) {
      linkList.add(link);
      return 0;
   }   
  }
  </code></pre>
  
  <p>After this I try to fetch the submitted links as <em>(in the jsp page)</em> :</p>
  
  <pre><code>        &lt;%! ArrayList&lt;String&gt; songList = new ArrayList&lt;String&gt;(); %&gt;
  
         &lt;%
             songList = StoreSongLink.linkList;
         %&gt; 
  
         &lt;% for (String links : songList){ %&gt;
               &lt;li&gt;&lt;%= links%&gt;&lt;/li&gt;
         &lt;%}%&gt;
  </code></pre>
  
  <p>I see the link submitted one or two time and then it gets vanished after I refresh the same page and I see the message that isn't any link submitted yet! Why is this so ? I know this may not be the best of approach but still I want to do this way.</p>
  
  <p>Why don't i see the link submitted after I refresh the page ? How is the data lost from the ArrayList ?</p>