tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Warren Crossing <>
Subject RE: How to set extension mapping
Date Wed, 04 Apr 2001 06:43:55 GMT
ok.. quickly.. 

add a servlet myRedirectServlet


the in the servlet ( pseudo code ) 

void service(ServletRequest req, ServletResponse res)  {

String jsp = this.turnXyzPath2JspPath ( req.getContextPath(),
req.getServletPath() ) ;

getServletContext().getRequestDispatcher( jsp ).forward( req,res ) ; 


turnXyzPath2JspPath ( .... 
//remember to prepend the /

unless you want to write a request interceptor 

-----Original Message-----
From: Lomesh Contractor []
Sent: Wednesday, 4 April 2001 4:23 PM
Subject: How to set extension mapping

Hi All,

	Here is my question.

	I want to map files with ".xyz" extension to be treated as a ".jsp"

	i.e. if any request comes with .xyz extension ( e.g.
http://myserver/mydomain/mydirectory/ )
	and if contains jsp code. So, for the above request the shud be compiled into servlet and then it 	shud send response
per the code written..

	To achieve this type of extension mappping what steps i have to take
configuration of tomcat server.

Hoping for quick reply


View raw message