How can I give value of HTML hidden field with spaces? Here i have used used string q to store y ques, suppose, what is 2 +2? And here the value of hidden field named 'q' is passed as only 'what'.
<%String q = request.getParameter("que"); 
out.print(q);
          out.print("<form action='postAns' method='post'>"+
            "<input type='hidden' name='que' value="+q+">" +"<br>"+
            "<input type='text' name='ans' >"+
            "<input type='submit' value='post'>"+
        "</form>");
%>
How can i get whole string for the value of 'que' in HTML form which is forwarded to postAns.java servlet? Even i used setAttribute but for jsp it is setting up properly.
Can anyone help in sorting out this?
 
    