title: Pass value of text box to java servlets
body: <p>Alright cannot find this anywhere and I was wondering how to grab the values of a text box from a jsp or servlet and display it in another servlet. </p>
  
  <p>Now my issue isn't passing the data and actually displaying it, my issue is that whenever a space is in the value I can only get that first bit of information. For example:</p>
  
  <pre><code>&lt;form method="post" action="Phase1Servlet"&gt;
  
    &lt;p&gt;Favorite Place:&lt;/p&gt; &lt;input type="text" name="place"&gt;&lt;/div&gt;
  
    &lt;input id="submit" type="submit"  value="Submit"&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>Say The user types in  "The Mall"</p>
  
  <p>in the Servlet I use:</p>
  
  <pre><code>String place = request.getParameter("place"); 
  </code></pre>
  
  <p>Then output the variable place somewhere in my code I only get the word "The"</p>
  
  <p>Do I need to use request.getParameterValues("place"); instead? If so how do I pass the values from servlet to servlet through a hidden field? When I do this:</p>
  
  <pre><code>String [] placeArr = request.getParameterValues("place");
  
  out.println("&lt;input type=\"hidden\" name=\"place\" value="+ placeArr +"&gt;");
  </code></pre>
  
  <p>The hidden field actually stores [Ljava.lang.String;@f61f5c</p>
  
  <p>Do i have to parse this or convert this somehow?</p>