W3C home > Mailing lists > Public > www-jigsaw@w3.org > May to June 1999

Re: Servlet Questions

From: David P. White <dpwhite@halcyon.com>
Date: Fri, 11 Jun 1999 11:47:20 -0400 (EDT)
Message-ID: <37613014.29D2@halcyon.com>
To: Benoit Mahe <Benoit.Mahe@sophia.inria.fr>
CC: www-jigsaw@w3.org
Benoit Mahe wrote:
> 
> The servletwrapper is not an alias, it's the way Jigsaw handle servlets.
> So yes, all servlets must be referenced via a ServletWrapper. But,
> you can call a servlet with is full classname.
> For example, it the servlet com.foobar.servlets.TestServlet is in your CLASSPATH
> 
> or under a ServletDirectory, you reach it at
> 
> http://hostname:port/servlet/com.foobar.servlets.TestServlet
> 
> A ServletWrapper, ("com.foobar.servlets.TestServlet"), will be
> created by the ServletIndexer.
> 
> Regards, Benoit.

Benoit,

When I first tried this, I merely placed my servlet's class file in the
servlet subdir under www. When I tried to reference it via it's fully
qualified classname, it was not found.

I then thought to place a series of subdir under the servlet subdir
which map to the elements of the servlet's classname. Therefore, with a
servlet named "foobar.servlets.TestServlet" the directory tree would be
www/servlet/foobar/servlets and the file TestServlet.class would be
placed therein.

When I do this, I can indeed reference the servlet with my browser
pointed to http://localhost:8001/servlet/foorbar.servlets.TestServlet.
However, this only works the very first time I reference it. If I point
my browser to another location and then back to the afore-mentioned
servlet, I get a text page displayed in my browser which simply says
"Servlet not configured properly". This occurs every time except the
first.

I have no idea what's going on here. When I look (via jigadmin) at the
servlet directory frame, it now includes a ServletWrapper called
"foo\servlets\TestServlet" which references class
"foo\servlets\TestServlet.class". In addition, jigadmin shows directory
resources/http frames for the directories placed under the servlet
directory (foo and servlets). For the file TestServlet.class, there is
also a file resource/http frame combination. Finally, in the jigsaw
console, I see, "Create Servlet : foo\servlets\TestServlet.class". There
are no other messages.

This all seems ok to me. Is it what you'd expect? Any idea why I cannot
access the servlet more than one time?

Finally, should I be able to place a .jar or .zip file containing
servlet code in the servlet directory under www? Or can these be only
.class files?

Thanks for your help.

David
Received on Friday, 11 June 1999 12:23:37 GMT

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