You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Rudnicki <jd...@pacbell.net> on 2000/11/23 05:24:06 UTC

Re: sample/myapp help (tomcat + apache + servlet not working, at leas t not as I would expect it too)

This is a fairly typical problem.  Tomcat is not at fault, to get started,
run it standalone and your problems will go away, the <servlet-mapping>'s
will start working, your hair will grow back, etc., etc.

Apache is the source of your problem.  It needs to be told that
localhost/myapp/hello
should be directed to the servlet engine.  When it sees
localhost/myapp/servlet/HelloServlet
it can use a simple servlet/* to forward.  But without the "servlet" it does
not know.

My first advice is to dump the mappings.  All they do is save you from
typing 8 character when authoring html pages.  This is what I do.

Second advice is to manually add an entry to the Apache config file for
_each and every_ mapping.  I gave up on this approach real quickly.

Jim

----- Original Message ----- >
> The problem:
> Has anyone been able to build the sample app that is in the
> doc/appdev/sample directory?  I can not get the servlet to run with
apache.
> If I try and access http://localhost/myapp/hello I get a page not found.
> http://localhost:8080/myapp/hello works, as does
> http://localhost/myapp/servlet/HelloServlet although the image does not
show
> up correctly because it's looking in /myapp/servlet/images not
/myapp/images
> which is understandable.  As far as I understand it you should be able to
> map /hello to /servlet/HelloServlet.  Is this not correct?  I'm hoping
> someone knows that one line that I have to put in tomcat-apache.conf to
make
> this work.

... etc ...