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


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

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

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

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

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


desc
@null
@


1.5
log
@null
@
text
@IDependOn-Set: 1
IDependOn-Set: 130
IDependOn-Set: 131
IDependOn-Set: 138
IDependOn-Set: 2
IDependOn-Set: 7
LastModifiedSecs: 925421277
Parent: 7
SequenceNumber: 2
Title: Using mod_rewrite to map arbitrary URLs to servlets
Part: 0
Author-Set: jon@@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 925421220
Type: monospaced
Lines: 39


----------
From: Steve Snodgrass <ssnodgra@@fore.com>
To: Java Apache Users <java-apache-users@@list.working-dogs.com>
Subject: Using mod_rewrite to map arbitrary URLs to servlets
Date: Thu, Apr 29, 1999, 1:58 PM


On Wed, Apr 28, 1999 at 11:44:33PM +0200, Jean-Luc Rochat wrote:
> use mod_rewrite for this one.

Thanks very much, mod_rewrite turned out to be the ticket for this problem.

I thought I'd summarize the solution to my problem to the list since someone
else may run into this.  Basically, this is a general way to map *any* URL to
a java servlet, including URLs in directories that you are already serving
HTML files out of.  This assumes that you have a zone set up to run servlets
under the /servlets URL.

First, you must have the mod_rewrite module, and the JServ module must come
*before* mod_rewrite in the AddModule list.  In other words:

AddModule mod_jserv.c
AddModule mod_rewrite.c

Then, you set up rewrite rules like this:

RewriteEngine on
RewriteRule ^/mantix/mxbooker$ /servlets/com.mx.webtime.servlets.MxBooker [PT]
RewriteRule ^/mantix/mxclerk$ /servlets/com.mx.webtime.servlets.MxClerk [PT]

Result:

URL /mantix/mxbooker runs servlet com.mx.webtime.servlets.MxBooker
URL /mantix/mxclerk  runs servlet com.mx.webtime.servlets.MxClerk

The key is using the [PT] flag (passthrough) with mod_rewrite, or else the
URLs will try to refer to files, which of course don't exist.
EndPart: 0
@


1.4
log
@null
@
text
@d4 1
a12 1
DateOfPart: 1999-Apr-29  2:27pm
d14 1
@


1.3
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 925421258
d8 1
a8 1
SequenceNumber: 1
d10 46
@


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


1.1
log
@null
@
text
@d2 1
@
