ok.. quickly.. 

add a servlet myRedirectServlet

<servlet>
                <servlet-name>myRedirectServlet</servlet-name>
                <servlet-class>com.nowhere.myRedirectServlet</servlet-class>
</servlet>
<servlet-mapping>
                <url-pattern>*.xyz</url-pattern>
                <servlet-name>myRedirectServlet</servlet-name>
</servlet-mapping>

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 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 4 April 2001 4:23 PM
To: [EMAIL PROTECTED]
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"
file.

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

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

Hoping for quick reply

Lomesh.

Reply via email to