0

Hi All,

I am working on an assignment where an applet has to communicate with a servlet.

It works fine with java data types, such as string etc, but when I try to use a class I have created, there is an exception thrown when it is cast into this class at the other end. The class i want to send does implement serializable, so I am not sure what is wrong.

Any ideas?

Thanks

Class user implements serializable

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {


            ObjectInputStream inputFromApplet = null;
            String theString;
            PrintWriter out = null;
            BufferedReader inTest = null;
            Users theUser = null;

            try
            {
                inputFromApplet = new ObjectInputStream(request.getInputStream());
                theUser = (Users) inputFromApplet.readObject();


                inputFromApplet.close();

            }
        
        catch(Exception ex)
        {
            ex.printStackTrace();
        }
2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by saurav
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.