tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "charly" <charly41...@yahoo.de>
Subject Fw: "filtering" / Mapping? problem after migrating TC from 4.1.x to 5.0.30
Date Sat, 01 Jul 2006 11:46:12 GMT
see below

----- Original Message ----- 
From: "charly" <charly41434@yahoo.de>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Saturday, July 01, 2006 11:56 AM
Subject: "filtering" / Mapping? problem after migrating TC from 4.1.x to 5.0.30


>I have a purchased webapp running on TC 4.1.30. For this webapp and the 
>versions
> before
> I developed a filtering servlet (years ago), which filtered the Outputstream 
> of
> one (ServletA) of the included webapp servlets
> (ServletA, ServletB, ServletC, ..) using following mappings and /or contexts:
>
> 1) purchased webapp:
>    context ROOT  "/"
>    servlet mappings
>       "/servlet/pathA"      mapped to ServletA
>       "/servlet/pathB"      mapped to ServletB
> ....
> +    "/servlet/XpathA"      mapped to ServletA
>
> 2) filtering webapp:
>    context   "/servlet/pathA"
>    servlet mapping
>       "/"   mapped to own FilteringServlet
>                  requests to "/servlet/pathA"  forwarded and filtered to
> "/servlet/XpathA"
>
> the filtering is done by forwarding the request using a URLConnection.
> (This was the only technique which I could get running for the 1. version
> on a former Netscape webserver.
> This allows also debugging the filter on my development PC/IDE,
> while using the production webapp)
> The only modification I had to do in the purchased webapp was the additional
> servlet mapping
> "/servlet/XpathA"      mapped to ServletA
> This technique had also the comfortable secondary effect that in case of 
> trouble
> the filtering could be disabled/removed on the fly just by simply undeploying
> the filtering webapp.
> This version worked perfect for me.
>
> Now I am migrating to the current version of the purchased webapp using the
> recommended TC 5.0.30.
>
> 1) purchased webapp:
>    context path  "/app"
>    servlet mappings
>        "/servlet/pathA"      mapped to ServletA
>        "/servlet/pathB"      mapped to ServletB
> ....
> +      "/servlet/XpathA"      mapped to ServletA
>
> The purchased webapp without filtering works as it should.
> I am also trying to deploy my filtering servlet:
>
> 2) filtering webapp:
>    context   "/app/servlet/pathA"
>    servlet mapping
>        "/"   mapped to own FilteringServlet
>                  requests to "/app/servlet/pathA"  forwarded and filtered to
> "/app/servlet/XpathA"
>
> But this does not function as expected because this tomcat version (container?
> DefaultServlet?)
> immediately redirects any "/app/servlet/pathA" requests to 
> "/app/servlet/pathA/"
> but this breaks the relative paths in the html code, so this filtering is
> broken/unusable.
> How could that redirect be suppressed/avoided?
> (also undeploying the context "/app/servlet/pathA" does not remove the 
> filtering
> as expected,
> it seems to make the path "/app/servlet/pathA" and so the purchased webapp
> unusable: error 50x)
>
> So how to migrate the filtering ?
> Of course I would like to do as little as possible.
> I also want to avoid Valves as this ist TC/version specific.
> I would also avoid a (servlet API) filter,
> which has to be added to the context of the purchased webapp,
> i.e. intermixing own code into the /app context
> ..
> Ok the simplest migration I can imagine
> which could function could be:
> 1) purchased webapp:
>     see above
>    servlet mappings:
>     ....
> +    "/servlet/XpathA"      mapped to ServletA
> +    "/servlet/XpathB"      mapped to ServletB
> ...

of course the mappings must be:
+    "/Xservlet/pathA"      mapped to ServletA
+    "/Xservlet/pathB"      mapped to ServletB


>
> 2) filtering webapp:
>    context  path "/app/servlet"
>    servlet mapping
>      "/"   mapped to own FilteringServlet
>                  requests to "/app/servlet/pathA"  forwarded and filtered to
> "/app/servlet/XpathA"
>                  requests to "/app/servlet/pathB"  forwarded and NOT filtered
> to "/app/servlet/XpathB"
> ....

of course the forwarding must be:
     "/app/servlet/pathA"  forwarded and filtered          to 
"/app/Xservlet/pathA"
     "/app/servlet/pathB"  forwarded and NOT filtered to "/app/Xservlet/pathB"

>
> Any other ideas, insights, suggestions?
>
> Thanks Karl-Heinz
>




	

	
		
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

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


Mime
View raw message