Urgent Help Needed regarding Serialization
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Junaid_Mohammad
Posted On:   Thursday, July 18, 2002 04:35 PM

My code is the following private String getDateUsingHttpObject() { try { URL url = new URL(getCodeBase(), "/servlet/loginServlet"); HttpMessage msg = new HttpMessage(url); // Properties props = new Properties(); // props.put(UserID, UserID); InputStream in = msg.sendGetMessage(); ObjectInputStream result = new ObjectInputStream(in); try { // Read the userID object from the stream userID = (String) result.readObject(); System.out.println("*****The userID is as follows"+userID); }    More>>

My code is the following





private String getDateUsingHttpObject()

{

try

{

URL url = new URL(getCodeBase(), "/servlet/loginServlet");

HttpMessage msg = new HttpMessage(url);



// Properties props = new Properties();

// props.put(UserID, UserID);



InputStream in = msg.sendGetMessage();

ObjectInputStream result = new ObjectInputStream(in);

try

{

// Read the userID object from the stream

userID = (String) result.readObject();

System.out.println("*****The userID is as follows"+userID);

}

catch(ClassNotFoundException cnfe)

{

cnfe.printStackTrace();

}

// Return the string representation of the userID

return userID.toString();

}

catch (Exception e)

{

// If there was a problem, print to System.out

// (typically the Java console) and return null

e.printStackTrace();

return null;

}

}







The error that i am getting is the following



java.io.IOException: Server returned HTTP response code: 405 for URL: http://localhost:8080/servlet/loginServlet

Please help

Junaid

   <<Less
About | Sitemap | Contact