-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike,
On 11/23/2009 7:17 AM, Looijmans, Mike wrote: > ... >> Note that you'll end up with two independent copies of the servlet >> in your two webapp directories, and they won't share things like >> Sessions between them. > > And, as I mentioned, I don't want that to happen. You basically have the following choices: 1) Deploy your webapp multiple times (not necessarily in separate Tomcat instances) 2) Use a filter to re-write requests on the fly and forward internally 3) Use a filter to redirect users to the proper URL If you really want to accept connections /only/ on port 666/xxx destined for myapp/xxx then you will necessarily need two <Service>s, two <Connectors>, and two deployments of the same webapp. If you can tolerate requests coming in on either 80 or 666 and only redirecting or forwarding, then you can get away with a single deployment of your webapp. >> You might, however, be able to get what you want using a >> combination of http://tuckey.org/urlrewrite/ and two Connectors >> defined on the same Service. > > Instead of introducing a third party component, it seems possible to > write a custom Filter to do this. Yes, you can write your own custom filter, but why not use one that's already been built specifically for this purpose? > All it needs to do is look at the incoming port and if that equals > 666 insert the "/myapp" into the url? More or less. > The documentation on Filters is large but provides - again - little > examples (like how to explain to Tomcat that I want to use this > filter...). The documentation for a Filter is light because a Filter itself only has two jobs: a) whatever you want to do and b) optionally, send the request along the chain to the next filter See section SRV 6 of the Servlet 2.5 Specification. It's really quite readable. > Anyway, I prefer any solution that stays within Tomcat. All of the solutions we will present will stay within Tomcat. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksL61wACgkQ9CaO5/Lv0PB5WACfcvLKWHVPVF5S9ZsbfeP0crbE VxYAoIfTat00c7572WPo/bBlY0M3cYp6 =BzJp -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org