title: Using JSTL tag in JSP to print array values from servlet
body: <p>I am having problem printing(Displaying) array data from JSP page which is send from Servlet. Here are the code and the out of the JSP page. Kindly, help me to trace the error i am making.</p>
  
  <p>MY SERVLET CODE:</p>
  
  <pre><code>//inside doGET method
  String title="Reading cookies example";
  String[] info={"What the hell!!","Nothing"};
  
  request.setAttribute("title", title);
  request.setAttribute("name", info);
  
  RequestDispatcher rd=request.getRequestDispatcher("myjsp.jsp");
  rd.forward(request, response);
  </code></pre>
  
  <p>MY JSP CODE:</p>
  
  <pre><code>&lt;%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
  &lt;%-- 
      Document   : myjsp
      Created on : Apr 5, 2014, 1:19:35 PM
      Author     : sabin
  --%&gt;
  
  &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;JSP Page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;c:forEach var="pagetitle" items="title"&gt;
              &lt;h1&gt;${title}&lt;/h1&gt;
          &lt;/c:forEach&gt;
          &lt;c:forEach var="data" items="{name}" &gt;
              &lt;C:OUT value="${data}"&gt;  &lt;/C:OUT&gt; 
              &lt;h1&gt;${name}&lt;/h1&gt;
  
          &lt;/c:forEach&gt;
  
  
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>OUTPUT PAGE:</p>
  
  <p>Reading cookies example
  [Ljava.lang.String;@195019d</p>
  
  <p>Instead of printing "What the hell" and Nothing its printing [Ljava.lang.String;@195019d. What is the reason and what i am missing? Would be very thankful if someone could assist me with this problem. Thanking you in Advance.</p>