Once I have treid this stuff in Android. I found that code and pasting some code snippet. I hope it will be helpful to you.
Code in Android:
Where convert is a mehod which converts InputStream to String
. I have intentionally not posted code for it.But google can help you out.
And below is my jsp
And I will suggest you to check port number and IP address once. And to generate response use Servlets
. MVC-2 is the great concept use it man.
Tell me if you still need a help.