Re: Redirecting a port to a webapp

2009-11-25 Thread Pid
On 25/11/2009 07:24, Looijmans, Mike wrote: I think so too. My personal doubt is still about how Tomcat would try map a request that comes in as /, being variable and being NOT myapp. Since it does not find a match with /myapp, and since obviously there cannot be an infinity of

RE: Redirecting a port to a webapp

2009-11-24 Thread Looijmans, Mike
Let's refresh the issue : A request comes into Tomcat for a URL /. It comes in either on port 80 or port 666. And you want it to be processed by the webapp at /myapp/. No: If it comes in at port 80, nothing different is supposed to happen. So / should do whatever / would

Re: Redirecting a port to a webapp

2009-11-24 Thread Peter Crowther
2009/11/24 Looijmans, Mike mike.looijm...@oce.com Because the is a random word, not a constant, nor the name of a servlet. Think wikipedia, the request might be for /foo or /bar or whatever, and the servlet uses that word for its own purposes (it will look it up in the database and return

Re: Redirecting a port to a webapp

2009-11-24 Thread André Warnier
Peter Crowther wrote: 2009/11/24 Looijmans, Mike mike.looijm...@oce.com Because the is a random word, not a constant, nor the name of a servlet. Think wikipedia, the request might be for /foo or /bar or whatever, and the servlet uses that word for its own purposes (it will look it up in

Re: Redirecting a port to a webapp

2009-11-24 Thread Christopher Schultz
-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

Re: Redirecting a port to a webapp

2009-11-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 11/23/2009 10:57 AM, André Warnier wrote: The first hurdle is that the HttpRequest is immutable, so you can't just change its URL and let the call through to the servlet(s). You have to subclass, or wrap, the original request, and then

RE: Redirecting a port to a webapp

2009-11-24 Thread Caldarale, Charles R
From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: Redirecting a port to a webapp Since it does not find a match with /myapp, and since obviously there cannot be an infinity of /webapps/ apps pre-configured, would it then pass it to the default app (/ROOT) ? Because then, that's

RE: Redirecting a port to a webapp

2009-11-24 Thread Looijmans, Mike
I think so too. My personal doubt is still about how Tomcat would try map a request that comes in as /, being variable and being NOT myapp. Since it does not find a match with /myapp, and since obviously there cannot be an infinity of /webapps/ apps pre-configured, would it

Re: Redirecting a port to a webapp

2009-11-23 Thread Peter Crowther
2009/11/23 Looijmans, Mike mike.looijm...@oce.com Hello, After hours of googling and browsing documentation, i came to the conclusion that what i want is either so trivial that everybody knows how to do it, or so complicated that no one ever tried it... I want to accomplish the following

Re: Redirecting a port to a webapp

2009-11-23 Thread Leon Rosenberg
On 23.11.2009, at 11:08, Looijmans, Mike mike.looijm...@oce.com wrote: Hello, After hours of googling and browsing documentation, i came to the conclusion that what i want is either so trivial that everybody knows how to do it, or so complicated that no one ever tried it... I want

Re: Redirecting a port to a webapp

2009-11-23 Thread André Warnier
Peter Crowther wrote: ... 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. That indeed looks to me like a way, if you want to stay entirely within Tomcat. It would have the benefit that there

RE: Redirecting a port to a webapp

2009-11-23 Thread Looijmans, Mike
... 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 might, however, be able to get what you want using a combination of

RE: Redirecting a port to a webapp

2009-11-23 Thread Looijmans, Mike
Because you want different sets of webapps served on your different connectors, I *think* you'll need two different Services in your server.xml: Server Service for port 80 Connector for port 80 Engine for port 80 Host for port 80, specifying base directory for your

Re: Redirecting a port to a webapp

2009-11-23 Thread Pid
On 23/11/2009 13:06, Looijmans, Mike wrote: Because you want different sets of webapps served on your different connectors, I *think* you'll need two different Services in your server.xml: Server Service for port 80 Connector for port 80 Engine for port 80 Host for port

RE: Redirecting a port to a webapp

2009-11-23 Thread Looijmans, Mike
I tried this, just to be able to make some progress on the actual project, but it does not work as expected. I copied theserver part and replaced: Host name=localhost appBase=webapps / with Host name=localhost appBase=webapps/myapp / You're telling the

RE: Redirecting a port to a webapp

2009-11-23 Thread Looijmans, Mike
nothing in the response or its headers to further explain what's wrong with the request. Mike. -Original Message- From: Looijmans, Mike Sent: maandag 23 november 2009 14:06 To: Tomcat Users List Subject: RE: Redirecting a port to a webapp Because you want different sets of webapps

Re: Redirecting a port to a webapp

2009-11-23 Thread Mark Thomas
Looijmans, Mike wrote: I tried this, just to be able to make some progress on the actual project, but it does not work as expected. I copied theserver part and replaced: Host name=localhost appBase=webapps / with Host name=localhost appBase=webapps/myapp / You're

RE: Redirecting a port to a webapp

2009-11-23 Thread Looijmans, Mike
No. You want webapps/myapp to be treated as the ROOT context for a host. appBase=webapps/myapp means look in the webapps/myapp directory to find contexts for this host. The ROOT context in that case would be webapps/myapp/ROOT As a general rule any configuration that boils down to

Re: Redirecting a port to a webapp

2009-11-23 Thread Peter Crowther
2009/11/23 Looijmans, Mike mike.looijm...@oce.com No. You want webapps/myapp to be treated as the ROOT context for a host. appBase=webapps/myapp means look in the webapps/myapp directory to find contexts for this host. The ROOT context in that case would be webapps/myapp/ROOT As a

Re: Redirecting a port to a webapp

2009-11-23 Thread André Warnier
Looijmans, Mike wrote: ... Instead of introducing a third party component, it seems possible to write a custom Filter to do this. All it needs to do is look at the incoming port and if that equals 666 insert the /myapp into the url? The documentation on Filters is large but provides - again -