On 24 Apr 2001, Chris Bailey wrote:

> On 24 Apr 2001 10:25:42 -0500, [EMAIL PROTECTED] wrote:
> > On 23 Apr 2001, Chris Bailey wrote:
> >
> > > This is what I'm already doing (see the email below) - I map my
> > > servlet to index.html in web.xml.
> >
> > Here's something you can try.  I haven't tried it exactly myself,
> > although I have tried something similar (i.e. having
> > http://www.foo.com/bar/ go directly to a servlet).  The steps below
> > are analogous to what I have done.
> >
> > First, add a directive to your tomcat/apache conf file that directs
> > *all* requests to tomcat's default context.  This might be something
> > like:
> >
> >   JkMount /* /ROOT
> >
> > (I'm using mod_jserv, not mod_jk, which is an additional reason I'm
> > not 100% sure of what exactly you need to do this part of it.)
> >
> > Second, add a servlet-mapping for the URL "/" to the servlet you wish
> > the requests to go to (I believe you'll have to have defined that
> > servlet, i.e. set up a servlet-name for it).  This should go in
> > tomcat's root context's web.xml file.
> >
> > That's it.
>
> This is orignally how I had it set up, but the problem was that by using
> "JkMount /* /whatever", which as you said, directs _all_ requests to
> Tomcat, it directs EVERY request to that domain to the servlet.  So, if
> for example, I put "http://www.blah.com/test/whatever.html"; in, that
> still matches "http://www.blah.com/*"; (the /* being the JkMount part),
> so it goes to the servlet as well.  This is undesireable (probably in
> most cases), becuase then if the browser requests say a stylesheet, or a
> static HTML file or whatever, it's all going to get mapped to the
> servlet.

Oh, I meant to mention that this is the downside of doing what I
suggested -- *everything* goes to the servlet :-).  This may or may
not be a problem, depending on your specifics (it's not a problem for
mine).

You may have mentioned it previously, but it's lost now -- what
version of Tomcat are you using?  3.X?  What you (and I) really want
is to allow the "welcome-file" to be a servlet.  From what I learned
when I inquired about this some time back, in 3.X, there is no way to
do this, but there is/will be in 4.X.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

Reply via email to