views:

43

answers:

2

Here is my code

invoke(String url){
HttpURLConnection urlCon = null;
urlCon = (HttpURLConnection) new URL(url).openConnection();
urlCon.connect();
return urlCon.getResponseCode();
}
**"Unexpected end of file from server"**

I got error message like this when i try to pass the url of the jsp file like this (http://kart3:7890/sample/sample.jsp) can u tell me am i miss anything

+1  A: 

Working with httpurlconnection is a little more complicated than in your example. This is a nice java tutorial that can help: http://download.oracle.com/javase/tutorial/networking/urls/readingWriting.html

spbfox
A: 

Hi Thanks for your reply I'll let u know once i check that

Kart3