Vijayamohan,
Try adding the code below.
Regards,
Rob Griffin
Quest Software
E-mail: [EMAIL PROTECTED]
Web site: http://www.quest.com
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Vijayamohan .Reddy Konduri
> Sent: Friday, 10 November 2000 3:21
> To: [EMAIL PROTECTED]
> Subject: applet--servlet communication...
>
>
> Hi,
> iam having problem in applet and servlet communication.iam passing
> userid,clientid,and password to servlet from applet.
> but,iam not able to get hold of servlet.my applet isnot
> able to recognize
> the servlet.can anyone help me in this.
> this is the code iam trying in applet to contact servlet and pass
> values to
> servlet:
>
> public void actionPerformed(ActionEvent e)
> {
> URL u = null;
> int i = -1;
> String str = null;
> if (e.getSource().equals(b1))
> {
> try
> {
> u = new
> URL("http://localhost:8080/servlet/appServlet?name="+a.getText().trim());
> System.out.println(u);
> URLConnection uc = u.openConnection();
uc.connect(); // <<<<<<<<<<<<<< add this
> InputStream is = uc.getInputStream();
> while ((i=is.read())!=-1)
> {
> str = str+String.valueOf(i);
> }
>
> is.close();
> a.setText(str);
>
> }
> catch(Exception ee)
>
> {
> System.out.println(ee);
> l3.setText("Server Not available.");
> }
> }
> --------------------------------------------------------------------------
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html