try {
String userToSearch = jButton1.getText();
String urlWithParameter = Constants.serverURL + Constants.searchUserServlet + "?us=" + userToSearch;
URL url = new URL(urlWithParameter);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
if(connection.getResponseCode() == 200) {
}else {
throw new Exception("Exception : Response code obtained is " + connection.getResponseMessage() + " while sending a request to search for the user");