>From [EMAIL PROTECTED]  Mon May 15 
>12:08:03 2000
Received: from scam.xcf.berkeley.edu (scam.XCF.Berkeley.EDU [128.32.43.201]) by 
lgs-systems.com (8.8.5) id MAA20836; Mon, 15 May 2000 12:07:59 -0600 (MDT)
Received: (qmail 35662 invoked by alias); 15 May 2000 18:04:13 -0000
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Delivered-To: mailing list [EMAIL PROTECTED]
Received: (qmail 35653 invoked from network); 15 May 2000 18:04:13 -0000
Received: from nwcst287.netaddress.usa.net (204.68.23.32)
  by scam.xcf.berkeley.edu with SMTP; 15 May 2000 18:04:13 -0000
Received: (qmail 13800 invoked by uid 60001); 15 May 2000 18:04:22 -0000
Message-ID: <[EMAIL PROTECTED]>
Received: from 204.68.23.32 by nwcst287 for [203.129.246.18] via 
web-mailer(34FM1.4.02C) on Mon May 15 18:04:22 GMT 2000
Date: 15 May 00 22:04:22 SMT
From: Rakesh Raveendran <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Problem Connecting between applet and servlet
CC: [EMAIL PROTECTED]
X-Mailer: USANET web-mailer (34FM1.4.02C)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
X-UIDL: bf18ed5e37d8913f79497bc73351b1d2

Hi,

  I was trying to connect to a servlet through an applet.I created an htm=
l
page with two frame.At the top frame the applet was embedded and in the b=
ottom
frame the servlet was server side included.I used the GET method to
communicate to the servlet.So in the init method of the applet I added th=
e
following code to get a connection to the servlet.And pass information th=
rough
the URL.
////////////////////////////////////////////////////////

 String
servletLocation=3D"http://172.100.8.213:8080/servlet/serv.HelloWorldServl=
et1?LastName=3D'Jones'";
try{
 testServlet =3D new URL( servletLocation );
}
catch (MalformedURLException e){
}

try{
servletConnection =3D testServlet.openConnection(); =

}
catch(IOException e){
}



///////////////////////////////////////////////////////////////////////
The code of the servlet is shown below,where I tried to get the informati=
on
passed from the applet

public class HelloWorldServlet1 extends HttpServlet {

   =

    public void doGet (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    {
        PrintWriter             out;

        res.setContentType("text/html");
        out =3D res.getWriter();
  String name=3Dreq.getParameter("LastName");
  =

        out.println("<html>");
        out.println("<head><title>Hello World</title></head>");
        out.println("<body>");
        out.println("<h1>LastName=3D"+name+"</h1>");
        out.println("</body></html>");
    }
}
/////////////////////////////////////////////

The output is showing a null value for the name.Is it wrong to send the
information to the servlet from the init method.Can you suggest some othe=
r
method or simple code for the communication.

regards,
Rakesh.


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=3D=
1

---
To unsubscribe, mail [EMAIL PROTECTED]
To get help, mail [EMAIL PROTECTED]


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to