• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Single quote in URL query string to a servlet while using HTTPS

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a servlet where a user question is passed to the servlet as parameter.
In simplified format, if the user question is "my tv doesn't work"
the call to the servlet will be made like this
https://server/a/b/servletname.serv?param1=74&entry=my%20tv%20doesn%27t%20work

This does not work and gives 403 error code.

The same servlet works fine in development environment where I use http instead of https.

I know the problem is becuase of the single quote in the user question as there is no problem
if I remove the single quote and ask a question like ' my tv does not work'.
I see that on the web site, the URL encoding is done and so %27 is passed to my servlet instead
of the single quote (').

I am trying to understand how to resolve this issue. I have done enough google and most of the places
it was advised to use URLEncoding. That is fine as we are using the same.

Now, the issue is why in https, even url encoded single quotes are not workig as part of the query string.

( I did see that the similar issue does not happen if instead of GET, POST is used.)

Please advise.

Neal
 
Neal Pressley
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please ignore the above question.It was due to a configuration in webserver which was not allowing special chracters in the query parameter.

Neal
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic