head	1.5;
access;
symbols;
locks
	nobody:1.5; strict;
comment	@# @;


1.5
date	99.06.09.05.21.07;	author nobody;	state Exp;
branches;
next	1.4;

1.4
date	99.06.09.05.15.20;	author nobody;	state Exp;
branches;
next	1.3;

1.3
date	99.06.09.05.15.01;	author nobody;	state Exp;
branches;
next	1.2;

1.2
date	99.06.09.05.14.51;	author nobody;	state Exp;
branches;
next	1.1;

1.1
date	99.06.09.05.14.29;	author nobody;	state Exp;
branches;
next	;


desc
@null
@


1.5
log
@null
@
text
@IDependOn-Set: 1
IDependOn-Set: 119
IDependOn-Set: 197
IDependOn-Set: 199
IDependOn-Set: 2
IDependOn-Set: 204
LastModifiedSecs: 928905320
Parent: 119
SequenceNumber: 2
Title: I have a directory within my servlets directory and things break when I try to use http://www.server.com/servlets/test/TestServlet, but when I put TestServlet directly in the servlets directory and remove the "test" from the URL, things work just fine. Is this a bug? 
Part: 0
Author-Set: jon@@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 928905320
Type: 
Lines: 7
No, this is not a bug but a wanted feature. This problem derives from the way Java structures classes into subdirectories per package name. People suffer similar problems writing non-servlet code. (we have a love-hate relationship with this approach: it's clean, but it creates deep directory trees.) Java would expect a file called $DIR/test/SimpleServlet to have the fully-qualified classname test.SimpleServlet. It looks in the 'test' subdirectory of each directory in the classpath for files in the 'test' package.


The module currently converts a request for test/SimpleServlet into a request for the class test.SimpleServlet. It finds the class file, but gets confused because the file actually contains a definition of the file 'SimpleServlet'. In short: make sure the package name declared in the class matches the directory structure where the class file is located.


To fix this particular problem: declare the servlet using a proper package name: org.dummy.test.SimpleServlet, compile it into $ROOT/servlets/org/dummy/test/SimpleServlet.class, and make your ServletPath $ROOT/servlets. Add an alias or servlet.simple.code property to generate a shorter URL if you like. (Thanks to Martin Pool)
EndPart: 0
@


1.4
log
@null
@
text
@d6 1
d15 1
@


1.3
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 928905301
d8 1
a8 1
SequenceNumber: 1
d10 13
@


1.2
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 928905269
d8 2
a9 2
SequenceNumber: 0
Title: New Item
@


1.1
log
@null
@
text
@d3 1
@
