tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Loïc Lefèvre <>
Subject RE: Best way to...
Date Tue, 31 Jul 2001 10:37:49 GMT
Yes seems to be one response to my problems and perhaps your problems... ;)
What you have to do is to:


            debug="1" />


            className="My Mapper"  <-- note it
            debug="1" />

then take (from the src .tar.gz file)
and play with it.

The point where you must work is in the "contextMap" method:

    public int contextMap( Request req )
	log("contextMap( "+req.toString()+" )"); // return req.getRequestURI()

	String path = req.getRequestURI();

	if( path==null)
	    	throw new RuntimeException("ASSERT: null path in request URI");

	// Place to modify path...

	if( path.indexOf("?") >=0 )
		throw new RuntimeException("ASSERT: ? in requestURI");

	 	String host=req.getServerName();
	    		cm.log("Host = " + host);

	    	Container container =(Container)map.getLongestPrefixMatch( host,
path );

	    	if( container == null )
			return 404;

You see that the main problem is to find the good container from the path
else you got a "404 page not found error". So you can manage the path
variable to reflect what you want...

note: decompiling the class MatcherDemoApplet.class in the
jakarta-oro-2.04.tar.gz package
      could give you a way to manage it and thus enhance considerably Tomcat
servlet aliasing ;)

Loïc Lefèvre

If you can't have something...
Build it!

-----Message d'origine-----
De : Pier P. Fumagalli []
Envoyé : mardi 31 juillet 2001 12:15
À :
Objet : Re: Best way to...

Loïc Lefèvre at wrote:

> Hi,
> I would like to know what is the best way to
> change tomcat package?
> Encoutering many problems with mod_rewrite + tomcat serlvet aliasing,
> I want to plug some code to enhance the way url-pattern are managed
> (by using jakarta oro).
> Have someone already work with this?
> Any idea?

Do you want to do something like a mod_rewrite in Java for Tomcat? :)
Would be cool :) Can't you use a Servlet and a RequestDispatcher?


View raw message