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.
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:
<form method="post" action="Phase1Servlet">
<p>Favorite Place:</p> <input type="text" name="place"></div>
<input id="submit" type="submit" value="Submit">
</form>
Say The user types in “The Mall”
in the Servlet I use:
String place = request.getParameter("place");
Then output the variable place somewhere in my code I only get the word “The”
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:
String [] placeArr = request.getParameterValues("place");
out.println("<input type=\"hidden\" name=\"place\" value="+ placeArr +">");
The hidden field actually stores [Ljava.lang.String;@f61f5c
Do i have to parse this or convert this somehow?
Should be
Escape the string in the hidden field