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 14:41:49 +0200
Message-ID: <37133B8D.3B9783F0@sophia.inria.fr>
To: Benoit Mahe <Benoit.Mahe@sophia.inria.fr>
CC: "Bi, Xiaolian" <Xiaolian_Bi@tri.sbc.com>, "'www-jigsaw@w3.org'" <www-jigsaw@w3.org>
Ok, I just check the ServletIndexer code and I fixed a bug,
Now the init will not be called each time the servlet is accessed.
(The bug occured only for URL like http://yourhost/servlet/com.xxx.MyServlet )
A new development version of jigsaw.zip will be available soon
at http://jigsaw.w3.org/Devel/classes/.

Regards, Benoit.


Benoit Mahe wrote:

> Actually, automatic install for servlets in package should work, but
> there is some problems, so it's better to install it by hands.
>
> Regards, Benoit.
>
> Benoit Mahe wrote:
>
> > "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
> > ---------------------------------------------------------------------
>
> --
> - Benoît Mahé -------------------------------------------------------
>                       World Wide Web Consortium   (W3C)
>                     Architecture domain - Jigsaw Engineer
>
>                http://www.w3.org/People/Mahe  - bmahe@w3.org
> ---------------------------------------------------------------------

--
- 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 08:41:57 GMT

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