title: passing an array from java to javascript using bean
body: <p>I am trying to pass a String[] from a java class to a jsp file, i manage to pass a simple String, but i am stuck on this one for few days now. Can someone help me, i wold like the answer to be more detailed since i am new at this.</p>
  
  <p><strong>Java class:</strong></p>
  
  <pre><code>public class UserArray extends Applet {
  
  public String  javaArray [] =
          { "array 1", "array 2" , "array 3" };
  
  public String [] getJavaArray() {
      return javaArray;
  }
  }
  </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;%@ taglib prefix="s" uri="/struts-tags" %&gt;
  &lt;%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;jsp:useBean id ="array" class="eu.xyx.ztr.applet.UserArray"/&gt;
  &lt;/head&gt;
  &lt;body&gt;
     &lt;h4&gt;
  
    &lt;jsp:getProperty name ="array" property="javaArray"/&gt; 
  
   &lt;/h4&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>So far i have maage to obtain the address of String[]. I just want to obtain the values of javaArray and if it is posible to obtain them in a form like this:</p>
  
  <pre><code>&lt;script&gt;
  
      function addrow(tableID){
  
  
          var numeuser=document.numeuser;
  
          var nume=["adrian","cristi","levi",numeuser];
          var prenume=["ric","dre","asd"];
          var email=["rew@td","qq@eqwq","ee@ew"];
  </code></pre>