You
don't have to use the jsp extension. Map them to your servlet name, but
without an extension. Your going to have to set your WEB.XML file up
anyways. Something like this:
<servlet-mapping>
<servlet-name>UserServices</servlet-name>
<url-pattern>/UserServices</url-pattern>
</servlet-mapping>
<servlet-name>UserServices</servlet-name>
<url-pattern>/UserServices</url-pattern>
</servlet-mapping>
I just
tested it, it works fine.
Wes
-----Original Message-----
From: Joe Krause [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 4:56 PM
To: '[EMAIL PROTECTED]'
Subject: RE: The "servlet" prefixThanks for getting back to me so quick. However, if i map my servlets to a .JSP extension, then I will still have to rewrite all the hyperlinks on the site. Right?-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 1:51 PM
To: [EMAIL PROTECTED]
Subject: RE: The "servlet" prefixI map my servlets to a .JSP extension, then I can use relative URLs both for my serlvets and in my servlets when I do redirects. This may not be the best way, but it works great.Wes-----Original Message-----
From: Joe Krause [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 4:31 PM
To: '[EMAIL PROTECTED]'
Subject: The "servlet" prefixHow 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.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/" />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
