tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Flaherty <pflah...@rampageinc.com>
Subject Re: Tomcat Filter Mapping Issue
Date Sun, 10 Jan 2010 20:04:26 GMT

On Jan 10, 2010, at 1:53 PM, Caldarale, Charles R wrote:

>> From: Patrick Flaherty [mailto:pflahrty@rampageinc.com]
>> Subject: Re: Tomcat Filter Mapping Issue
>>
>> I don't touch that app, I leave it alone and it remains the
>> machine's ROOT APP.
>
> No, it is that particular <Host>'s ROOT app; not the machine's.  
> Every <Host> must have a ROOT app, and most likely not the ROOT app  
> that ships with Tomcat's localhost <Host>.
>
>> If running three apps on one host , how do you get to those apps.
>
> If by "host", you mean a <Host> entry in server.xml, the apps will  
> have different names under the appBase directory of that <Host>.   
> One should be named ROOT, the others can be whatever you want your  
> users to refer to them as.
>
>> Example one is a Single Host domain name called www.myapp.com.
>>
>> To get to app1, I would type http://www.myapp.com/app1
>> To get to app2, I would type http://www.myapp.com/app2
>> To get to app3, I would type http://www.myapp.com/app3
>
> Correct.  You also need a ROOT app to handle URIs for www.myapp.com  
> that don't reference app1, app2, or app3.
>
>> I don't like to have our customers having to add /app1 or /app2  or
>> /app3 to the end of SINGLE URL (domain name) to get to a  
>> particular app.
>
> Don't confuse URL with domain name; the domain name is only a part  
> of a URL.  The users are going to need to differentiate the apps by  
> some means, and the part after the domain name is as good as any.
>
>> But I'm pretty sure this is VALID and SHOULD work but the additional
>> leg appended to the URL to get to a particular app is awful to me.
>
> How do you suggest the users specify which app they want to  
> access?  Your misgivings are unfounded.
>
>> Host name = "www.myapp1.com"   appbase = "c:/app1"
>> Host name = "www.myapp2.com"   appbase = "c:/app2"
>> Host name = "www.myapp3.com"   appbase = "c:/app3"
>
> O.k. so far, but it does give the (sometimes desirable) impression  
> that there are three different servers.
>
>> The content of each appBase folder is all of our app files.
>
> That's where you're not getting it.  The app files must go under C:/ 
> appx/ROOT, not directly under the appBase.
>
>> These folders (c:/app1, c:/app2, c:/app3) behave like the web
>> root of each of the domain names (www.myapp1.com, www.myapp2.com,
>> www.myapp3.com) accordingly.
>
> Wrong.  The appBase is just the location of *all* webapps for the  
> <Host>.  The default webapp for the <Host> MUST be placed in a  
> directory named ROOT (case sensitive) UNDER the appBase directory.   
> Other webapps for the <Host> - if any - go into other directories  
> under that <Host>'s appBase.

Ahh !!!! That makes sense Finally ! The appBase is just a location  
for ALL webapps for a given <Host>. Therefore every <Host> MUST have  
at least a ROOT app which MAY be the only app
for that <Host>. GOT IT !  One final question on your final  
statement.  If I have 3 apps for a given <Host> then off my appBase I  
would have :

/ROOT  (a must default for each <Host>)
/app2
/app3

To access these apps, the URL's for the apps would be :

http://www.my-three-apps.com  (This for the ROOT app)
http://www.my-three-apps.com/app2  (This for the /app2 app)
http://www.my-three-apps.com/app3  (This for the /app3 app)

If this is correct I finally got it.

Thanks Hassan for the link, my books are outdated and are being tossed.

Thank you Chuck, I hope my last reply is correct. (We were not  
deployed this way for years yet it did worked, which is what I got  
caught up on.

Thanks to all again.

-P



>
>> If this is NOT valid please give an example of deploying three app
>> from one machine.
>
> We already did, several times, as does the doc page Hassan pointed to.
>
>> By the way this configuration is where FIlter Mapping was NOT  
>> working.
>
> Completely understandable, since it's an invalid configuration.
>
>> I did change my FILTER MAPPING PATTERN in my web.xml to be
>> /ROOT/Proofs/* and then I started to get my FILTER MAPPING HITS.
>
> No, the webapp name (ROOT in this case) must not be part of the  
> filter mapping.
>
>> Actually now I have found that I can leave my app in c:/app1 and just
>> make the changes noted above (add ROOT/Proofs to my appBase path and
>> change my FILTER MAPPING PATTERN in my web.xml to be /ROOT/Proofs/*
>> and then I started to get my FILTER MAPPING HITS.)
>
> More dumb luck, depending on the behavior of this particular  
> version of Tomcat when presented with a broken, invalid  
> configuration.  Just do it the right way.
>
>> There is something magic about adding the folder ROOT and having it
>> end up in the URL's being passed back and forth for ME to start
>> getting FILTER MAPPING HITS.
>
> It's not magic, it's defined behavior; ROOT is the default webapp  
> for the <Host>.
>
>> Do you still have the same thought after what I covered above ?
>
> Yes, you're still refusing to do things in the proper, documented way.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE  
> PROPRIETARY MATERIAL and is thus for use only by the intended  
> recipient. If you received this in error, please contact the sender  
> and delete the e-mail and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message