This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes Single quote in URL query string to a servlet while using HTTPS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Single quote in URL query string to a servlet while using HTTPS" Watch "Single quote in URL query string to a servlet while using HTTPS" New topic
Author

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

Neal Pressley
Greenhorn

Joined: May 29, 2008
Posts: 14
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

Joined: May 29, 2008
Posts: 14
Please ignore the above question.It was due to a configuration in webserver which was not allowing special chracters in the query parameter.

Neal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Single quote in URL query string to a servlet while using HTTPS