• Post Reply Bookmark Topic Watch Topic
  • New Topic

to Ignore parameter separator when passed as string  RSS feed

 
nandy desikan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a search text box in one application. On click of submit button, the search string entered by user is appended to the target app URL and form is submitted.
The "+" is the parameter separator between the URL and the search string . When I use the "+" as part of the search string itself, then the "+" is stripped off from the
search string when submitted to the target application. I want the "+" in search string to be used as it is and must not be removed when passed to target application

Can anyone please help me on this. I am clueles..

Regards,
nandydesikan
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you properly encoding the string? I'm guessing not.

So le me get this straight -- you're appending the param to a form submission?

Create a hidden input with the values and the form submission will handle the encoding for you.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, the "+" character is not the parameter separator. A URL is formatted like the following:

As you can see, the question mark is used to separate the list of parameters from the main URL, and the ampersand character is used to separate one parameter from another.

The "+" symbol is used as the encoding for spaces in the URL.

FYI.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!