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 01:33:37 GMT


--------------------------------------------------
From: "Konstantin Kolinko" <knst.kolinko@gmail.com>
Sent: Saturday, January 09, 2010 7:00 PM
To: "Tomcat Users List" <users@tomcat.apache.org>
Subject: Re: Tomcat Filter Mapping Issue

> 2010/1/10 Patrick Flaherty <pflahrty@rampageinc.com>:
>> Chris,
>>
>> Although adding ROOT of my appBase fixed my Filter mapping issue, I'm
>> guessing that I need to
>> put every bit of my app (all classes, libs etc ....) into that ROOT 
>> folder,
>> correct ?
>>
>> So then if I decide to deploy another app in a virtual host say for 
>> instance
>> :
>>
>> Host Name : www.domain.com   appBase=c:/app123
>>
>> If that has a folder called proofs that I want filter mapping hits on, do 
>> I
>> created a ROOT folder off of my appBase (ie  c:/app123/ROOT) and put
>> every bit of my app (all classes, libs etc ....) into that ROOT folder ?
>>
>> I'm sorry to belabor the point. I know that adding the ROOT folder fixed 
>> my
>> initial problem but I not sure if that is because when only running 1 
>> host
>> it
>> should be called ROOT or is it that every Host needs to have a ROOT 
>> folder
>> off of it's appBase and everything should bit of the app should be put in
>> there.
>>
>> It seems the ROOT folder was the key here but before we wanted to add 
>> filter
>> mapping app worked fine when appBase is what we deemed to be the web
>> root for the app. It has worked well like that for years.
>>
>> Is there a hard and fast rule about deployment that I'm missing ? 
>> (Probably)
>> If there is. it seems to revolve around having a ROOT folder for each app
>> maybe ?
>>
>> Any more enlightenment would be appreciated.
>>
>> Thanks once again.
>>
>
> ROOT (in uppercase) is not a "folder", but a web application.

Yes, that is understood.
>
> It behaves like any other web application (You should remember, that
> web applications are independent of each other). The only difference
> is that it is mapped to the URL "/".

Your say the ROOT app is mapped to URL "/" then yes that is understood.
>
> Every host should have a ROOT application.

Meaning every host should have a ROOT app regardless of whether you are 
hosting ONE or MORE apps on a host !

>
> Any requests that cannot be mapped to any other web application  will
> be directed to this one, so that it can show its 404th error page or
> otherwise process it.
>
> (If there is no ROOT application deployed, such requests cannot be
> processed and will result in a zero-length empty response.)
>
>
> If you have two applications
>  /mywebapp
>  /ROOT
> then
> - any request to /myweapp/foo will be processed by mywebapp (and the
> ROOT one will not see it at all),

That is what I had. I had the ROOT app off the webapps folder of a default 
Tomcat install.
We then created a virtual host (with a real domain name) where OUR app 
responded to
that domain name. (ie Host Name : www.myapp.com  appBase =  c:/myapp)
Everything in this config has worked for a couple years. The infamous Proofs 
folder was
located in c:/myapp/Proofs which I assume c:/myapp to be the "web root" for 
this www.myapp.com host.
It seems to have always behaved as such.

Am I ok up to this point ? (maybe not ?)

Finally we decided a wanted to use Filter Mapping for added security. Filter 
Mapping would not give us a hit
for an URL's of type http://www.myapp.com/Proofs/* (our filter map using 
/Proofs/*).

After suggestions from the forum about moving the app (WEB_INF and all) 
under a ROOT folder I added to c:/myapp
folder which now contains everything for the app under it, viola, Filter 
Mapping started to work !

I don't know why this was the case but I went with it.

> - any request to /myweapp2/foo will be processed by ROOT (because
> there is no myweapp2 application to process it).
Do people have secondary app (after ROOT) setup like I described above 
running  with filter mapping functioning ?

Seems like maybe a bug to me or a misconfiguration of some sort on my part.

Thanks again Konstantin and other.


>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> 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