Greetings,

I'm trying to invoke a servlet from an applet and receive some data from the
servlet into my applet. Though the servlet is returning the data, I'm not
able to display that into my applet. Kindly suggest me where I went wrong.

Thanks,
Mani

The piece of code used to invoke the servlet and retrieve data from it is:


        String argStr = "?" + URLEncoder.encode("EmpId") + "=" +
URLEncoder.encode(jtEmpId.getText().trim());
        URL url = new URL("http://localhost:8080/servlet/ServTest"+argStr);
        URLConnection con = url.openConnection();
        con.setDoInput(true);
        con.setUseCaches(false);

        DataInputStream dis = (DataInputStream)con.getInputStream();

        String returnStr = dis.readLine();

        jtReturnValue.setText("String received : "+returnStr);

___________________________________________________________________________
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

Reply via email to