• Post Reply Bookmark Topic Watch Topic
  • New Topic

passing a string with spaces as a parameter

 
farhath farook
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i have an application where i have to pass a string with spaces in between to a servlet.
following is the code snip

<td> <input type="checkbox" name="tests" value= <%=reports[i]%> > <%=reports[i]%>

if i do in this way i can get only the first word of the string in the next page...
but i want the entire string..


thanks in advance
 
Sunil Kumar
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you are using get method for form submission. If so,

configure the server.xml to enable the


OR

Use the java.net.URLDecoder.decode() to decode the url query. e.g. java.net.URLDecoder.decode(request.getQueryString(), formSubmitEncoding) while using getParameter
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to surround the value with double quotes.



Learn HTML properly.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sunil Kumar:
Looks like you are using get method for form submission. If so,

configure the server.xml to enable the


OR

Use the java.net.URLDecoder.decode() to decode the url query. e.g. java.net.URLDecoder.decode(request.getQueryString(), formSubmitEncoding) while using getParameter


This is not applicable here. That's not a solution for the problem of the topicstarter.
 
Sunil Kumar
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah.. i got that now.. Thanks Bauke!
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lesson learnt: do not only read topic titles.
 
Sunil Kumar
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't quiet understand the question, that's why answered the post conditionally with "If so"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!