• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

to Ignore parameter separator when passed as string

 
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
 
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
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.
 
expectation is the root of all heartache - shakespeare. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic