You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Carl Olivier <ca...@unysen.co.uk> on 2005/11/25 15:14:42 UTC

Filters

Greetings.
 
I have a questions regarding Filter servlets.  If a request is made for a
non-existent/non *.jsp or servlet URI - will the Filter be instantiated?
Reason I ask is because I want to interect old bookmarked requests for an
old site - which has been migrated to a new tomcat based JSP site - however
the old site was ASP based.
 
Many users of the old site would have bookmarked something like:
/index.asp?PageID=16 or something similar - and I am hoping to be able to
intercept that - using a Filter seemed a logical choice - and send back a
redirect to the new URL /some.jsp for those requests.
 
Thanks in advance,
 
Carl


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Filters

Posted by Carl Olivier <ca...@unysen.co.uk>.
AH.

Damn, my aplogies - the mapping!  Of course - *slaps forhead* :)

Thanks a stack!

Rgds,

Carl 

-----Original Message-----
From: Reynir Hubner [mailto:reynir@hugsmidjan.is] 
Sent: 25 November 2005 14:23
To: Tomcat Users List
Subject: Re: Filters

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,

Sure, you can map your filter on to /* or something like that. That way you
can intercept any URL you like and either rewrite, or redirect.
It doesn't matter if your URL reads /something/something/default.asp or not,
if you know how to handle that url from your filter (usually done by reading
config from file or database). If you are using mod_jk then you might have
to change your mapping in to tomcat.

I've been implementing this by using filters for a long time, never had
problems with it.

hope it helps
- -reynir




Carl Olivier wrote:
> Greetings.
>  
> I have a questions regarding Filter servlets.  If a request is made 
> for a non-existent/non *.jsp or servlet URI - will the Filter be
instantiated?
> Reason I ask is because I want to interect old bookmarked requests for 
> an old site - which has been migrated to a new tomcat based JSP site - 
> however the old site was ASP based.
>  
> Many users of the old site would have bookmarked something like:
> /index.asp?PageID=16 or something similar - and I am hoping to be able 
> to intercept that - using a Filter seemed a logical choice - and send 
> back a redirect to the new URL /some.jsp for those requests.
>  
> Thanks in advance,
>  
> Carl
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDhx5K19KgIQihNwgRAjtxAJ9SjYarLFkzoBNAWHc6OeLUiD3S6QCgqN9v
BzHRkrnr2XJC1jQ6VKEoDH8=
=JLxP
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Filters

Posted by Reynir Hubner <re...@hugsmidjan.is>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,

Sure, you can map your filter on to /* or something like that. That way
you can intercept any URL you like and either rewrite, or redirect.
It doesn't matter if your URL reads /something/something/default.asp or
not, if you know how to handle that url from your filter (usually done
by reading config from file or database). If you are using mod_jk then
you might have to change your mapping in to tomcat.

I've been implementing this by using filters for a long time, never had
problems with it.

hope it helps
- -reynir




Carl Olivier wrote:
> Greetings.
>  
> I have a questions regarding Filter servlets.  If a request is made for a
> non-existent/non *.jsp or servlet URI - will the Filter be instantiated?
> Reason I ask is because I want to interect old bookmarked requests for an
> old site - which has been migrated to a new tomcat based JSP site - however
> the old site was ASP based.
>  
> Many users of the old site would have bookmarked something like:
> /index.asp?PageID=16 or something similar - and I am hoping to be able to
> intercept that - using a Filter seemed a logical choice - and send back a
> redirect to the new URL /some.jsp for those requests.
>  
> Thanks in advance,
>  
> Carl
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDhx5K19KgIQihNwgRAjtxAJ9SjYarLFkzoBNAWHc6OeLUiD3S6QCgqN9v
BzHRkrnr2XJC1jQ6VKEoDH8=
=JLxP
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Filters

Posted by ALEX HYDE <al...@btinternet.com>.
Carl,

I'm quite new to this but I'd guess that the Filter is
instantiated at start-up by Tomcat. You might direct
your new requests, plus the old requests for the asp
pages, to Tomcat, using say Apache. Using a filter you
could intercept *.asp and then forward/redirect to the
new resource.

--- Carl Olivier <ca...@unysen.co.uk> wrote:

> Greetings.
>  
> I have a questions regarding Filter servlets.  If a
> request is made for a
> non-existent/non *.jsp or servlet URI - will the
> Filter be instantiated?
> Reason I ask is because I want to interect old
> bookmarked requests for an
> old site - which has been migrated to a new tomcat
> based JSP site - however
> the old site was ASP based.
>  
> Many users of the old site would have bookmarked
> something like:
> /index.asp?PageID=16 or something similar - and I am
> hoping to be able to
> intercept that - using a Filter seemed a logical
> choice - and send back a
> redirect to the new URL /some.jsp for those
> requests.
>  
> Thanks in advance,
>  
> Carl
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 



		
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org