Check down a bit in your web.xml, or possible server.xml or one of the
..xml config files, you should see something like
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>logVerbosityLevel</param-name>
<param-value>WARNING</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
and then a bit down lower
<!-- The mapping for the JSP servlet -->
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
That's the only reason that .jsp files are interpreted as such.
Oh, my bad, well I think this post might be relvant anyway so I'll
post
it anyway.
So you want to map
http://server/m to /foobar.jsp? Yeah, I would just
set up a nice Redirector Servlet:
public class RedirectorServlet extends HttpServlet {
private String redirect = null;
public void init() throws ServletException {
this.redirect = getInitParameter("redirect");
}
public void doGet( HttpServletRequest request,
HttpServletResponse response )
throws ServletException, IOException {
if (redirect == null)
throw new ServletException("Cannot redirect to null.");
else
response.sendRedirect(redirect);
}
}
and then have in your web.xml:
<servlet>
<servlet-name>redirector</servlet-name>
<servlet-class>com.scovetta.Redirector</servlet-class>
<init-param>
<param-name>redirect</param-name>
<param-value>/foobar.jsp</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>redirector</servlet-name>
<url-pattern>/m</url-pattern>
</servlet-mapping>
That should handle what you want-- you might need to make the url
pattern
/m/* or /m*, I haven't tested it.
Hope that helps--
Mike Scovetta