title: How to pass parameters from servlet to JavaScript
body: <p>I am working on a board game with dynamic board size of 5x5,...,8x8<br>
  This should be a game that runs on a web.  </p>
  
  <p>I am working with NetBeans and tomcat as the server for testing. </p>
  
  <p>I have the GameSettings.html which the user choose the board size and press submit.  </p>
  
  <p>The data is being sent to servlet named: GameSettingsServlet.java  </p>
  
  <p>There I pull out the boardSize and parse it to an integer:  </p>
  
  <pre><code>@Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
  
     createEngine(request);
  
     processRequest(request, response);
  }
  
  private void createEngine(HttpServletRequest request)
  {
      int boardSize = Integer.parseInt(request.getParameter("boardSize"));
      int numberOfPlayers = Integer.parseInt(request.getParameter("numberOfPlayers"));
      m_Engine = new Engine(boardSize, numberOfPlayers );
  }
  </code></pre>
  
  <p>I want to create the board with javaScript so I need to send the boardSize parameter to the   javaScript (which should run on BoardGame.html)  in order to know how much rows and columns to create.</p>
  
  <p>How can I pass the boardSize to the javaScript or HTML ?</p>
  
  <p>I searched on the web but I found only about JSP and I need it on HTML.</p>