Alright couldn't find this anywhere, and I was wondering how to grab the values ββof a text field from jsp or servlet and display it in another servlet.
Now my problem is not transmitting data and actually displaying it, my problem is that whenever the space is in the value, I can only get this first bit of information. For instance:
<form method="post" action="Phase1Servlet"> <p>Favorite Place:</p> <input type="text" name="place"></div> <input id="submit" type="submit" value="Submit"> </form>
Say what the user enters in "The Mall"
in the servlets that I use:
String place = request.getParameter("place");
Then print the place of the variable somewhere in my code, I get the word "The"
Do I need to use request.getParameterValues ββ("place"); instead? If so, how do I pass the values ββfrom the servlet to the 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 is stored [Ljava.lang.String; @ f61f5c
Does it need to be sorted out or converted somehow?
source share