I am trying to figure out how to pass multiple parameters in a URL. I want to pass latitude and longitude from my android class to a java servlet. How can I do that?
You can pass multiple parameters as "?param1=value1¶m2=value2"
But it's not secure. It's vulnerable to Cross Site Scripting (XSS) Attack.
Your parameter can be simply replaced with a script.
Have a look at this article and article
You can make it secure by using API of StringEscapeUtils
static String escapeHtml(String str)
Escapes the characters in a String using HTML entities.
Even using https url for security without above precautions is not a good practice.
Have a look at related SE question:
Is URLEncoder.encode(string, "UTF-8") a poor validation?