W3C home > Mailing lists > Public > www-jigsaw@w3.org > March to April 1998

Servlet Problems!

From: Wolfgang Platzer <wplatzer@iaik.tu-graz.ac.at>
Date: Wed, 15 Apr 1998 11:50:29 +0200
Message-ID: <009301bd6853$eccb4280$1cea1b81@kopernikus.iaik.tu-graz.ac.at>
To: "Jigsaw Mailinglist" <www-jigsaw@w3.org>

I modified Jigsaw to set additional parameters for a request:

import test.TestClass;

  TestClass t = new TestClass();
  request.setState("test.test_class", t);


and then I wrote a servlet:

     TestClass tc = (TestClass)req.getAttribute("test.test_class");

But this line always causes a ClassCastException. If I write

    Object o = req.getAttribute("test.test_class");
    System.out.println(o.getClass().getName());

I get

    test.TestClass.

It seems that Servlets use another ClassLoader than Jigasaw. Is this a
general Problem with Servlets or is this problem specific to Jigsaw?
If I use java.lang.String instead of test.TestClass there is no
ClassCastException. Why?

Can someone explain this?

Wolfgang



--
Dipl.-Ing. Wolfgang Platzer
Technische Universitaet Graz - University of Technology Graz
Institut für Angewandte Informationsverarbeitung
und Kommunikationstechnologien
Klosterwiesgasse 32/I, A-8010 Graz,
Tel: ++43 316 873-5527,Fax: ++43 316 873-5520
URL <http://www.iaik.tu-graz.ac.at/index.html>
Received on Wednesday, 15 April 1998 05:52:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:27 GMT