I have tried the way you mentioned to call the servlet from the client side.

But the connection is not getting established between the client and the server.

Even I have a similar requirement...