How do you get rid
of the "servlet" prefix that Tomcat appends to every servlet URL? I have a web
site that is currently using jserv, but we are upgrading the server and I want
to move the site over to tomcat. However, tomcat's default behaviour is to stick
the work "servlet" in the URL between the context name and the servlet being
accessed. This breaks all my HREFs. Instead of rewritting all the HREFs on 50
pages, I want tomcat to not use a the "servlet" prefix. I have tracked this
default behaviour down to a couple of lines in the server.xml
file.
<!--
Non-standard invoker, for backward compat. ( /servlet/*
)
You can modify the prefix that is matched by adjusting the
"prefix" parameter below. Be sure your modified pattern
starts and ends with a slash.
You can modify the prefix that is matched by adjusting the
"prefix" parameter below. Be sure your modified pattern
starts and ends with a slash.
NOTE: This prefix applies to *all* web applications
that
are running in this instance of Tomcat.
-->
<RequestInterceptor
className="org.apache.tomcat.request.InvokerInterceptor"
debug="0" prefix="/servlet/" />
are running in this instance of Tomcat.
-->
<RequestInterceptor
className="org.apache.tomcat.request.InvokerInterceptor"
debug="0" prefix="/servlet/" />
The problem is
that when i remove this RequestInterceptor or make prefix="" or prefix="/"
- i don't get access to the servlets and end up with a 404 error. Has anyone
seen this problem before? Can anyone help me?
Thanks for taking
the time to read this!
Joe
Krause
