If you have everything correct, the re-direction should work
when you use port 8080, but fail on port 80 because Apache
doesn't know about the change. You can tell Apache in
either or two ways as described below:
Take a look at:
http://www.jguru.com/jguru/faq/view.jsp?EID=140877
for a solution using the Apache directive LocationMatch.
Another solution is to use the mount directive. E.g.,
ApJServMount /intranet/servlet /intranet
ApJServMount /intranet/jsp-bin /intranet
The equivalent Jk directive is
JkMount /intranet/servlet/* ajp12
JkMount /intranet/jsp-bin/* ajp12
In the archives, search for the subject "Servlet configuration"
and read Jacob Kjome's informative postings.
Whether you use LocationMatch or the appropriate Mount directive
in your tomcat-apache.conf file, you *MUST* also modify your
context's web.xml file and add an URL-PATTERN (E.g.,
<url-pattern> /jsp-bin/*</url-pattern> ).
Ken.
On Fri, 03 Nov 2000, you wrote:
> I've done the same thing my self. What you have below looks okay. Are you
> sure the servlet class name is right? Including package name and
> capitalization? Can you directly access the servlet? Do you have other
> mappings to /* or for the servlet? Even just:
>
> <servlet-mapping>
> <servlet-name>router</servlet-name>
> <url-pattern>/router</url-pattern>
> </servlet-mapping>
>
> If you have conflicting mappings, I believe only the first is followed. In
> your case, you can't have any other mappings for the servlet.
>
> I tested my mappings using the example app that came with tomcat.
>
> I used the mappping of the SnoopServlet:
>
> <servlet>
> <servlet-name>
> snoop
> </servlet-name>
> <servlet-class>
> SnoopServlet
> </servlet-class>
> </servlet>
>
> to map http://myhost:8080/snoop/reports/ to the snoop servlet
>
> <servlet-mapping>
> <servlet-name>
> snoop
> </servlet-name>
> <url-pattern>
> /reports/*
> </url-pattern>
> </servlet-mapping>
>
> Also mapped the snoop servlet to *.xxx
>
> <servlet-mapping>
> <servlet-name>
> snoop
> </servlet-name>
> <url-pattern>
> *.xxx
> </url-pattern>
> </servlet-mapping>
>
> -----Original Message-----
> From: Matt Goss [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 03, 2000 12:57 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: servlet mappings???
>
>
> Hi all,
> I'm attempting to map a controller servlet so that any requests go
> through it... (the MVC method).
> I have a context/application called test that is accessable via the URL
> "http://myhost.com/test/". In the web.xml file (in the
> "webapps/test/WEB-INF" directory) I put the following mapping:
> <servlet>
> <servlet-name>router</servlet-name>
> <servlet-class>router</servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>router</servlet-name>
> <url-pattern>/*</urlpattern>
> </servlet-mapping>
>
> the idea is that I should be able to request the file test.jsp and have
> the router servlet pick up the request (to test for a login)...but the
> servlet never gets the request... the test.jsp page just comes right
> up.... grrrrr...
> I'm requesting it with the URL "http://myhost.com/test/test.jsp".
> Any ideas/suggestions???
> Matt Goss
--
Kenneth R. Kress [EMAIL PROTECTED]