Hi,
Thanks for ur reply now it working fine I want to send the userid and password to my
servlet on the action event of my submit button for that i try to code like below but it is not sending userid and password to my servlet.Can any one plz guide me how i can do that.
submit.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try{
String userid1;
String password1;
String url="http://127.0.0.1:8080/examples/servlet/loginServlet";
userid1 = userid.getText();
password1 = password.getText();
u = new URL(url+"?name=" +userid1 + "&path=" + password1);
uc = (HttpURLConnection)u.openConnection();
uc.setDoOutput(true);
uc.setDoInput(true);
uc.setUseCaches(false);
uc.setRequestProperty("Content-Type","application/octet-stream");
printout = new DataOutputStream(uc.getOutputStream ());
}catch(Exception ex){System.out.println("Error from actionPerformed :" +
ex.getMessage());}
}
});
Regards
Bikash