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

Re: init() called everytime

From: Benoit Mahe <Benoit.Mahe@sophia.inria.fr>
Date: Tue, 13 Apr 1999 10:35:08 +0200
Message-ID: <371301BC.99DAA10F@sophia.inria.fr>
To: "Bi, Xiaolian" <Xiaolian_Bi@tri.sbc.com>
CC: "'www-jigsaw@w3.org'" <www-jigsaw@w3.org>
"Bi, Xiaolian" wrote:

> Sorry to repost the question. I got some response but still didn't solve my
> problem.
>
> My init() seems to be called every time when the servlet is accessed. And in
> fact from the printout of Jigsaw it looks like the servlet is loaded every
> time. One response said that if the serlvet is used without the .class
> extension, it should be okay. But I have been using the serlvet without the
> .classs extension all along.
>
>  I am using the automatic installation, ie my servlet MyServlet.class is
> under WWW/servlet/com/xxx/xxx . I am accessing the serlvet with
> com.xxx.xxx.MyServlet
> com.xxx.xxx.xxx is the package name.

Oh!! I see.
Automatic installation is not supposed not work for servlets
in a package, you should add it by hand. So read the
manual installation page for servlet [1] .
Add a ServletWrapper under /servlet and set the class field to
com.xxx.xxx.MyServlet ...

Note: The fact that http://yourhost/servlet/com.xxx.xxx.MyServlet
"works" is a side effect, this is not the right way to access your servlet.
(but this could be)

[1] http://www.w3.org/Jigsaw/Doc/User/servlets.html#install-servlets

Regards, Benoit.

>
>
> It's really crucial to my application that the init() is only called once
> when the servlet is loaded (should only be loaded once as I understand it).
> Can someone please tell me what I am doing wrong?
>
> Xiaolian Bi

--
- Benoît Mahé -------------------------------------------------------
                      World Wide Web Consortium   (W3C)
                    Architecture domain - Jigsaw Engineer

                http://www.w3.org/People/Mahe  - bmahe@w3.org
---------------------------------------------------------------------
Received on Tuesday, 13 April 1999 04:35:14 GMT

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