You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sylvain Goulmy <sy...@gmail.com> on 2011/11/29 18:47:30 UTC

Tomcat 7 - New attribut aliases in the context configuration item

Hi all,

I'd like to know it is possible to have equivalent functionality to the
"extended document root" provided by the WebSphere product. This feature
allows you to define a location outside the webapp to make contribution
without having to redeploy the application. This mechanism first checks if
the resource is present in the application and if not will look for it in
the directory extension.

I thought that the functionality provided by the new attribute aliases for
the configuration item <context> would have a similar behavior, but I see
another operation. First of all it is not possible to set an alias on the
context '/', making it necessary to declare all the directories in which
you want to make the contribution. Also when I set an alias for a directory
present in my webapp, it becomes a priority and files in my webapp are no
longer available.

Do I understand correctly how this new attribute aliases has to be used ?

Is it possible with Tomcat 7 to set up a mechanism similar to the extended
document root of Websphere?

Thank you in advance for your support.

Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Sylvain Laurent <sl...@apache.org>.
Here is the preview of the documentation : http://ci.apache.org/projects/tomcat/tomcat7/docs/config/context.html#Virtual_webapp (this is a nightly snapshot of the tomcat 7 branch)

On 6 déc. 2011, at 17:31, Sylvain Goulmy wrote:

> Hi Sylvain,
> 
> I have taken the sources from the trunk version and i compiled T7.
> 
> Can you please give me an example of the declaration of the ressource i
> should do in my context in order to have the benefit of this functionnality
> ? I don't understand the <loader> part of your comment in the bugzilla
> ticket.
> 
> What is the order of the research of the ressources when you have
> additional directories defined for your application ? I'm gonna have a look
> at your code but i'm not a java expert so i prefer asking in order to avoid
> any confusion.
> 
> Thank you for your support.

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


Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Sylvain Laurent <sl...@apache.org>.
On 6 déc. 2011, at 18:07, Sylvain Goulmy wrote:

> Hi Sylvain,
> 
> I have tested your functionnality thanks to the description you give in
> your code.
> 
> This is just EXACTLY what i wanted. I can define an external directory, the
> ressources are searched in my application and then in the directory defined
> in the configuration, and icing on the cake you can define the '/' context
> for your new directory.
> 
> This is just perfect !
> 
> I see in your comment that this functionnality is not meant to be used in
> production, why ?

This is rather a disclaimer ;-) I really did not test for potential security threats when using this feature, I don't know what happens if the URL contains sequences like ../../...
Nor did I do performance tests.
The primary goal was to fix the "serve modules without publishing" feature of eclipse which used to work with tc6 but was broken with tc7.

> 
> Could this functionnality be backported to Tomcat 6 or a patch could be
> provided ?
Probably, but since the "Serve modules without publishing feature" of eclipse works as is, there was no point in touching this...
If there's really some demand, I could have a look at it.

> 
> Thank you very much for pointing this bugzilla ticket ;-)
> 

you're welcome.

Sylvain
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Sylvain Goulmy <sy...@gmail.com>.
Hi Sylvain,

I have tested your functionnality thanks to the description you give in
your code.

This is just EXACTLY what i wanted. I can define an external directory, the
ressources are searched in my application and then in the directory defined
in the configuration, and icing on the cake you can define the '/' context
for your new directory.

This is just perfect !

I see in your comment that this functionnality is not meant to be used in
production, why ?

Could this functionnality be backported to Tomcat 6 or a patch could be
provided ?

Thank you very much for pointing this bugzilla ticket ;-)


On Tue, Dec 6, 2011 at 5:31 PM, Sylvain Goulmy <sy...@gmail.com> wrote:

> Hi Sylvain,
>
> I have taken the sources from the trunk version and i compiled T7.
>
> Can you please give me an example of the declaration of the ressource i
> should do in my context in order to have the benefit of this functionnality
> ? I don't understand the <loader> part of your comment in the bugzilla
> ticket.
>
> What is the order of the research of the ressources when you have
> additional directories defined for your application ? I'm gonna have a look
> at your code but i'm not a java expert so i prefer asking in order to avoid
> any confusion.
>
> Thank you for your support.
>
>
> On Mon, Dec 5, 2011 at 10:04 PM, Sylvain Laurent <sl...@apache.org>wrote:
>
>> It's not for eclipse only. The ticket talks about eclipse because that
>> was the main motivation for the feature, but it's totally independent.
>>
>>
>> On 5 déc. 2011, at 15:15, Sylvain Goulmy wrote:
>>
>> > Well, what is described in this ticket seems to concern Tomcat in the
>> > Eclipse environment, i'd like to have the functionnality on the live
>> > environment, i'll keep on watching your patch to see if that can give me
>> > the functionnality i'm looking for.
>> >
>> > Thank you for this information.
>> >
>> > On Fri, Dec 2, 2011 at 8:11 PM, Sylvain Laurent <sl...@apache.org>
>> wrote:
>> >
>> >> keep a watch on
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=51741. When it is
>> implemented, it should give you this functionality.
>> >>
>> >>
>> >> On 30 nov. 2011, at 14:58, Sylvain Goulmy wrote:
>> >>
>> >>>>
>> >>>> So the effect is that multiple physical directories must be searched
>> for
>> >>>> a given resource?
>> >>>
>> >>>
>> >>> Correct.
>> >>>
>> >>> The alias maps a given path to an external directory.
>> >>>
>> >>>
>> >>> Ok, that's what i had understood.
>> >>>
>> >>> Can you give an example of how you would like it to work?
>> >>>
>> >>>
>> >>> Here is the description of the EDR (Extended Document Root) mecanism
>> in
>> >>> Websphere :
>> >>>
>> >>> Let's assume i have the following application :
>> >>>
>> >>> - Webapps/
>> >>>        - MyApplication/
>> >>>                    - images/
>> >>>                    - css/
>> >>>                    - META-INF/
>> >>>                    - WEB-INF/
>> >>>                    - index.html
>> >>>
>> >>> I can define an EDR directory in the configuration of my application
>> so
>> >>> that the ressource i access are first retrieved from my application
>> and
>> >>> then in the EDR directory if they don't exist in my application.
>> >>>
>> >>> - /.../.../.../.../EDR/
>> >>>                     - images/
>> >>>                     - index.html
>> >>>
>> >>> These directories are defined as "extension" of my application and
>> >> another
>> >>> important thing is that i can also extend files which are at the root
>> of
>> >> my
>> >>> application (as index.html).
>> >>>
>> >>> After a few more test with Tomcat i understand that :
>> >>>
>> >>> - You cannot "extend" directory, if you define an external location
>> which
>> >>> math an existing directory of your application, the ressources of your
>> >>> application become unreachable.
>> >>>
>> >>> - As the documentation say "Using '/' as an aliasPath is not
>> allowed.",
>> >> you
>> >>> cannot extend any ressource which is at the root of your application.
>> >>>
>> >>> Things seems clear for me now, please tell if i have missed something.
>> >>>
>> >>> Thank you in advance for your support.
>> >>>
>> >>>
>> >>> On Wed, Nov 30, 2011 at 11:53 AM, Pid <pi...@pidster.com> wrote:
>> >>>
>> >>>> On 29/11/2011 17:47, Sylvain Goulmy wrote:
>> >>>>> Hi all,
>> >>>>>
>> >>>>> I'd like to know it is possible to have equivalent functionality to
>> the
>> >>>>> "extended document root" provided by the WebSphere product. This
>> >> feature
>> >>>>> allows you to define a location outside the webapp to make
>> contribution
>> >>>>> without having to redeploy the application. This mechanism first
>> checks
>> >>>> if
>> >>>>> the resource is present in the application and if not will look for
>> it
>> >> in
>> >>>>> the directory extension.
>> >>>>
>> >>>> So the effect is that multiple physical directories must be searched
>> for
>> >>>> a given resource?
>> >>>>
>> >>>>
>> >>>>> I thought that the functionality provided by the new attribute
>> aliases
>> >>>> for
>> >>>>> the configuration item <context> would have a similar behavior, but
>> I
>> >> see
>> >>>>> another operation. First of all it is not possible to set an alias
>> on
>> >> the
>> >>>>> context '/', making it necessary to declare all the directories in
>> >> which
>> >>>>> you want to make the contribution. Also when I set an alias for a
>> >>>> directory
>> >>>>> present in my webapp, it becomes a priority and files in my webapp
>> are
>> >> no
>> >>>>> longer available.
>> >>>>>
>> >>>>> Do I understand correctly how this new attribute aliases has to be
>> >> used ?
>> >>>>
>> >>>> The alias maps a given path to an external directory.
>> >>>>
>> >>>>
>> >>>>> Is it possible with Tomcat 7 to set up a mechanism similar to the
>> >>>> extended
>> >>>>> document root of Websphere?
>> >>>>
>> >>>> Can you give an example of how you would like it to work?
>> >>>>
>> >>>>
>> >>>> p
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>>
>> >>>> [key:62590808]
>> >>>>
>> >>>>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
>

Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Sylvain Goulmy <sy...@gmail.com>.
Hi Sylvain,

I have taken the sources from the trunk version and i compiled T7.

Can you please give me an example of the declaration of the ressource i
should do in my context in order to have the benefit of this functionnality
? I don't understand the <loader> part of your comment in the bugzilla
ticket.

What is the order of the research of the ressources when you have
additional directories defined for your application ? I'm gonna have a look
at your code but i'm not a java expert so i prefer asking in order to avoid
any confusion.

Thank you for your support.


On Mon, Dec 5, 2011 at 10:04 PM, Sylvain Laurent <sl...@apache.org>wrote:

> It's not for eclipse only. The ticket talks about eclipse because that was
> the main motivation for the feature, but it's totally independent.
>
>
> On 5 déc. 2011, at 15:15, Sylvain Goulmy wrote:
>
> > Well, what is described in this ticket seems to concern Tomcat in the
> > Eclipse environment, i'd like to have the functionnality on the live
> > environment, i'll keep on watching your patch to see if that can give me
> > the functionnality i'm looking for.
> >
> > Thank you for this information.
> >
> > On Fri, Dec 2, 2011 at 8:11 PM, Sylvain Laurent <sl...@apache.org>
> wrote:
> >
> >> keep a watch on
> https://issues.apache.org/bugzilla/show_bug.cgi?id=51741. When it is
> implemented, it should give you this functionality.
> >>
> >>
> >> On 30 nov. 2011, at 14:58, Sylvain Goulmy wrote:
> >>
> >>>>
> >>>> So the effect is that multiple physical directories must be searched
> for
> >>>> a given resource?
> >>>
> >>>
> >>> Correct.
> >>>
> >>> The alias maps a given path to an external directory.
> >>>
> >>>
> >>> Ok, that's what i had understood.
> >>>
> >>> Can you give an example of how you would like it to work?
> >>>
> >>>
> >>> Here is the description of the EDR (Extended Document Root) mecanism in
> >>> Websphere :
> >>>
> >>> Let's assume i have the following application :
> >>>
> >>> - Webapps/
> >>>        - MyApplication/
> >>>                    - images/
> >>>                    - css/
> >>>                    - META-INF/
> >>>                    - WEB-INF/
> >>>                    - index.html
> >>>
> >>> I can define an EDR directory in the configuration of my application so
> >>> that the ressource i access are first retrieved from my application and
> >>> then in the EDR directory if they don't exist in my application.
> >>>
> >>> - /.../.../.../.../EDR/
> >>>                     - images/
> >>>                     - index.html
> >>>
> >>> These directories are defined as "extension" of my application and
> >> another
> >>> important thing is that i can also extend files which are at the root
> of
> >> my
> >>> application (as index.html).
> >>>
> >>> After a few more test with Tomcat i understand that :
> >>>
> >>> - You cannot "extend" directory, if you define an external location
> which
> >>> math an existing directory of your application, the ressources of your
> >>> application become unreachable.
> >>>
> >>> - As the documentation say "Using '/' as an aliasPath is not allowed.",
> >> you
> >>> cannot extend any ressource which is at the root of your application.
> >>>
> >>> Things seems clear for me now, please tell if i have missed something.
> >>>
> >>> Thank you in advance for your support.
> >>>
> >>>
> >>> On Wed, Nov 30, 2011 at 11:53 AM, Pid <pi...@pidster.com> wrote:
> >>>
> >>>> On 29/11/2011 17:47, Sylvain Goulmy wrote:
> >>>>> Hi all,
> >>>>>
> >>>>> I'd like to know it is possible to have equivalent functionality to
> the
> >>>>> "extended document root" provided by the WebSphere product. This
> >> feature
> >>>>> allows you to define a location outside the webapp to make
> contribution
> >>>>> without having to redeploy the application. This mechanism first
> checks
> >>>> if
> >>>>> the resource is present in the application and if not will look for
> it
> >> in
> >>>>> the directory extension.
> >>>>
> >>>> So the effect is that multiple physical directories must be searched
> for
> >>>> a given resource?
> >>>>
> >>>>
> >>>>> I thought that the functionality provided by the new attribute
> aliases
> >>>> for
> >>>>> the configuration item <context> would have a similar behavior, but I
> >> see
> >>>>> another operation. First of all it is not possible to set an alias on
> >> the
> >>>>> context '/', making it necessary to declare all the directories in
> >> which
> >>>>> you want to make the contribution. Also when I set an alias for a
> >>>> directory
> >>>>> present in my webapp, it becomes a priority and files in my webapp
> are
> >> no
> >>>>> longer available.
> >>>>>
> >>>>> Do I understand correctly how this new attribute aliases has to be
> >> used ?
> >>>>
> >>>> The alias maps a given path to an external directory.
> >>>>
> >>>>
> >>>>> Is it possible with Tomcat 7 to set up a mechanism similar to the
> >>>> extended
> >>>>> document root of Websphere?
> >>>>
> >>>> Can you give an example of how you would like it to work?
> >>>>
> >>>>
> >>>> p
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>>
> >>>> [key:62590808]
> >>>>
> >>>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>

Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Sylvain Laurent <sl...@apache.org>.
It's not for eclipse only. The ticket talks about eclipse because that was the main motivation for the feature, but it's totally independent.


On 5 déc. 2011, at 15:15, Sylvain Goulmy wrote:

> Well, what is described in this ticket seems to concern Tomcat in the
> Eclipse environment, i'd like to have the functionnality on the live
> environment, i'll keep on watching your patch to see if that can give me
> the functionnality i'm looking for.
> 
> Thank you for this information.
> 
> On Fri, Dec 2, 2011 at 8:11 PM, Sylvain Laurent <sl...@apache.org> wrote:
> 
>> keep a watch on https://issues.apache.org/bugzilla/show_bug.cgi?id=51741. When it is implemented, it should give you this functionality.
>> 
>> 
>> On 30 nov. 2011, at 14:58, Sylvain Goulmy wrote:
>> 
>>>> 
>>>> So the effect is that multiple physical directories must be searched for
>>>> a given resource?
>>> 
>>> 
>>> Correct.
>>> 
>>> The alias maps a given path to an external directory.
>>> 
>>> 
>>> Ok, that's what i had understood.
>>> 
>>> Can you give an example of how you would like it to work?
>>> 
>>> 
>>> Here is the description of the EDR (Extended Document Root) mecanism in
>>> Websphere :
>>> 
>>> Let's assume i have the following application :
>>> 
>>> - Webapps/
>>>        - MyApplication/
>>>                    - images/
>>>                    - css/
>>>                    - META-INF/
>>>                    - WEB-INF/
>>>                    - index.html
>>> 
>>> I can define an EDR directory in the configuration of my application so
>>> that the ressource i access are first retrieved from my application and
>>> then in the EDR directory if they don't exist in my application.
>>> 
>>> - /.../.../.../.../EDR/
>>>                     - images/
>>>                     - index.html
>>> 
>>> These directories are defined as "extension" of my application and
>> another
>>> important thing is that i can also extend files which are at the root of
>> my
>>> application (as index.html).
>>> 
>>> After a few more test with Tomcat i understand that :
>>> 
>>> - You cannot "extend" directory, if you define an external location which
>>> math an existing directory of your application, the ressources of your
>>> application become unreachable.
>>> 
>>> - As the documentation say "Using '/' as an aliasPath is not allowed.",
>> you
>>> cannot extend any ressource which is at the root of your application.
>>> 
>>> Things seems clear for me now, please tell if i have missed something.
>>> 
>>> Thank you in advance for your support.
>>> 
>>> 
>>> On Wed, Nov 30, 2011 at 11:53 AM, Pid <pi...@pidster.com> wrote:
>>> 
>>>> On 29/11/2011 17:47, Sylvain Goulmy wrote:
>>>>> Hi all,
>>>>> 
>>>>> I'd like to know it is possible to have equivalent functionality to the
>>>>> "extended document root" provided by the WebSphere product. This
>> feature
>>>>> allows you to define a location outside the webapp to make contribution
>>>>> without having to redeploy the application. This mechanism first checks
>>>> if
>>>>> the resource is present in the application and if not will look for it
>> in
>>>>> the directory extension.
>>>> 
>>>> So the effect is that multiple physical directories must be searched for
>>>> a given resource?
>>>> 
>>>> 
>>>>> I thought that the functionality provided by the new attribute aliases
>>>> for
>>>>> the configuration item <context> would have a similar behavior, but I
>> see
>>>>> another operation. First of all it is not possible to set an alias on
>> the
>>>>> context '/', making it necessary to declare all the directories in
>> which
>>>>> you want to make the contribution. Also when I set an alias for a
>>>> directory
>>>>> present in my webapp, it becomes a priority and files in my webapp are
>> no
>>>>> longer available.
>>>>> 
>>>>> Do I understand correctly how this new attribute aliases has to be
>> used ?
>>>> 
>>>> The alias maps a given path to an external directory.
>>>> 
>>>> 
>>>>> Is it possible with Tomcat 7 to set up a mechanism similar to the
>>>> extended
>>>>> document root of Websphere?
>>>> 
>>>> Can you give an example of how you would like it to work?
>>>> 
>>>> 
>>>> p
>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> 
>>>> [key:62590808]
>>>> 
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> 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


Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Sylvain Goulmy <sy...@gmail.com>.
Well, what is described in this ticket seems to concern Tomcat in the
Eclipse environment, i'd like to have the functionnality on the live
environment, i'll keep on watching your patch to see if that can give me
the functionnality i'm looking for.

Thank you for this information.

On Fri, Dec 2, 2011 at 8:11 PM, Sylvain Laurent <sl...@apache.org> wrote:

> keep a watch on https://issues.apache.org/bugzilla/show_bug.cgi?id=51741. When it is implemented, it should give you this functionality.
>
>
> On 30 nov. 2011, at 14:58, Sylvain Goulmy wrote:
>
> >>
> >> So the effect is that multiple physical directories must be searched for
> >> a given resource?
> >
> >
> > Correct.
> >
> > The alias maps a given path to an external directory.
> >
> >
> > Ok, that's what i had understood.
> >
> > Can you give an example of how you would like it to work?
> >
> >
> > Here is the description of the EDR (Extended Document Root) mecanism in
> > Websphere :
> >
> > Let's assume i have the following application :
> >
> > - Webapps/
> >         - MyApplication/
> >                     - images/
> >                     - css/
> >                     - META-INF/
> >                     - WEB-INF/
> >                     - index.html
> >
> > I can define an EDR directory in the configuration of my application so
> > that the ressource i access are first retrieved from my application and
> > then in the EDR directory if they don't exist in my application.
> >
> > - /.../.../.../.../EDR/
> >                      - images/
> >                      - index.html
> >
> > These directories are defined as "extension" of my application and
> another
> > important thing is that i can also extend files which are at the root of
> my
> > application (as index.html).
> >
> > After a few more test with Tomcat i understand that :
> >
> > - You cannot "extend" directory, if you define an external location which
> > math an existing directory of your application, the ressources of your
> > application become unreachable.
> >
> > - As the documentation say "Using '/' as an aliasPath is not allowed.",
> you
> > cannot extend any ressource which is at the root of your application.
> >
> > Things seems clear for me now, please tell if i have missed something.
> >
> > Thank you in advance for your support.
> >
> >
> > On Wed, Nov 30, 2011 at 11:53 AM, Pid <pi...@pidster.com> wrote:
> >
> >> On 29/11/2011 17:47, Sylvain Goulmy wrote:
> >>> Hi all,
> >>>
> >>> I'd like to know it is possible to have equivalent functionality to the
> >>> "extended document root" provided by the WebSphere product. This
> feature
> >>> allows you to define a location outside the webapp to make contribution
> >>> without having to redeploy the application. This mechanism first checks
> >> if
> >>> the resource is present in the application and if not will look for it
> in
> >>> the directory extension.
> >>
> >> So the effect is that multiple physical directories must be searched for
> >> a given resource?
> >>
> >>
> >>> I thought that the functionality provided by the new attribute aliases
> >> for
> >>> the configuration item <context> would have a similar behavior, but I
> see
> >>> another operation. First of all it is not possible to set an alias on
> the
> >>> context '/', making it necessary to declare all the directories in
> which
> >>> you want to make the contribution. Also when I set an alias for a
> >> directory
> >>> present in my webapp, it becomes a priority and files in my webapp are
> no
> >>> longer available.
> >>>
> >>> Do I understand correctly how this new attribute aliases has to be
> used ?
> >>
> >> The alias maps a given path to an external directory.
> >>
> >>
> >>> Is it possible with Tomcat 7 to set up a mechanism similar to the
> >> extended
> >>> document root of Websphere?
> >>
> >> Can you give an example of how you would like it to work?
> >>
> >>
> >> p
> >>
> >>
> >>
> >>
> >> --
> >>
> >> [key:62590808]
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Sylvain Laurent <sl...@apache.org>.
keep a watch on https://issues.apache.org/bugzilla/show_bug.cgi?id=51741 . When it is implemented, it should give you this functionality.


On 30 nov. 2011, at 14:58, Sylvain Goulmy wrote:

>> 
>> So the effect is that multiple physical directories must be searched for
>> a given resource?
> 
> 
> Correct.
> 
> The alias maps a given path to an external directory.
> 
> 
> Ok, that's what i had understood.
> 
> Can you give an example of how you would like it to work?
> 
> 
> Here is the description of the EDR (Extended Document Root) mecanism in
> Websphere :
> 
> Let's assume i have the following application :
> 
> - Webapps/
>         - MyApplication/
>                     - images/
>                     - css/
>                     - META-INF/
>                     - WEB-INF/
>                     - index.html
> 
> I can define an EDR directory in the configuration of my application so
> that the ressource i access are first retrieved from my application and
> then in the EDR directory if they don't exist in my application.
> 
> - /.../.../.../.../EDR/
>                      - images/
>                      - index.html
> 
> These directories are defined as "extension" of my application and another
> important thing is that i can also extend files which are at the root of my
> application (as index.html).
> 
> After a few more test with Tomcat i understand that :
> 
> - You cannot "extend" directory, if you define an external location which
> math an existing directory of your application, the ressources of your
> application become unreachable.
> 
> - As the documentation say "Using '/' as an aliasPath is not allowed.", you
> cannot extend any ressource which is at the root of your application.
> 
> Things seems clear for me now, please tell if i have missed something.
> 
> Thank you in advance for your support.
> 
> 
> On Wed, Nov 30, 2011 at 11:53 AM, Pid <pi...@pidster.com> wrote:
> 
>> On 29/11/2011 17:47, Sylvain Goulmy wrote:
>>> Hi all,
>>> 
>>> I'd like to know it is possible to have equivalent functionality to the
>>> "extended document root" provided by the WebSphere product. This feature
>>> allows you to define a location outside the webapp to make contribution
>>> without having to redeploy the application. This mechanism first checks
>> if
>>> the resource is present in the application and if not will look for it in
>>> the directory extension.
>> 
>> So the effect is that multiple physical directories must be searched for
>> a given resource?
>> 
>> 
>>> I thought that the functionality provided by the new attribute aliases
>> for
>>> the configuration item <context> would have a similar behavior, but I see
>>> another operation. First of all it is not possible to set an alias on the
>>> context '/', making it necessary to declare all the directories in which
>>> you want to make the contribution. Also when I set an alias for a
>> directory
>>> present in my webapp, it becomes a priority and files in my webapp are no
>>> longer available.
>>> 
>>> Do I understand correctly how this new attribute aliases has to be used ?
>> 
>> The alias maps a given path to an external directory.
>> 
>> 
>>> Is it possible with Tomcat 7 to set up a mechanism similar to the
>> extended
>>> document root of Websphere?
>> 
>> Can you give an example of how you would like it to work?
>> 
>> 
>> p
>> 
>> 
>> 
>> 
>> --
>> 
>> [key:62590808]
>> 
>> 


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


Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Sylvain Goulmy <sy...@gmail.com>.
Hi Christopher,

What does it mean to "extend" an existing file? Replace it or do some
> kind of horrendous merge?


Here is the order of the ressource research :

- Files from my application
- Files from the EDR

If the ressource is defined both in my app and in the EDR directory then
the one from the application has the priority. There is no horrendous merge
;-)

I talk about an extension as you can have exactly the same directory/files
defined in the your EDR and in your application. The main advantage of the
EDR directory is that i can complete my application by adding ressources
(html/jsp/...) without any deployment. This mecanism is used for
application which have a daily contribution for example.

You might be able to build this capability yourself by writing your
> own DirContext and specifying it with a <Resources> element within
> your <Context> element. See
> http://tomcat.apache.org/tomcat-7.0-doc/config/resources.html for details.


This new track looks nice but the documentatino on the subject is a little
short. I'll try to find more information on the subject but if you
have additional
information to tell me, let me know!

Thank you for your support.

On Fri, Dec 2, 2011 at 9:14 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Sylvain,
>
> On 11/30/11 8:58 AM, Sylvain Goulmy wrote:
> > These directories are defined as "extension" of my application and
> > another important thing is that i can also extend files which are
> > at the root of my application (as index.html).
>
> What does it mean to "extend" an existing file? Replace it or do some
> kind of horrendous merge?
>
> > After a few more test with Tomcat i understand that :
> >
> > - You cannot "extend" directory, if you define an external location
> > which math an existing directory of your application, the
> > ressources of your application become unreachable.
>
> That sounds about right.
>
> > - As the documentation say "Using '/' as an aliasPath is not
> > allowed.", you cannot extend any ressource which is at the root of
> > your application.
>
> Right: if you alias /, you are essentially deploying another webapp --
> so you should just do that instead.
>
> Tomcat's alias mechanism is intended for use in the case where you
> have a bunch of static content in a separate directory and you just
> want to be able to serve it through the same webapp without actually
> deploying two separate contexts. That's why it works the way it does.
>
> You might be able to build this capability yourself by writing your
> own DirContext and specifying it with a <Resources> element within
> your <Context> element. See
> http://tomcat.apache.org/tomcat-7.0-doc/config/resources.html for details.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk7ZMaIACgkQ9CaO5/Lv0PDfsgCgjRhQvBbs0DDkCu4ckHZc2Gtl
> ckMAnAuBNfU8UwZyqNfP1JvWX0oDeYAc
> =PL/2
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sylvain,

On 11/30/11 8:58 AM, Sylvain Goulmy wrote:
> These directories are defined as "extension" of my application and
> another important thing is that i can also extend files which are
> at the root of my application (as index.html).

What does it mean to "extend" an existing file? Replace it or do some
kind of horrendous merge?

> After a few more test with Tomcat i understand that :
> 
> - You cannot "extend" directory, if you define an external location
> which math an existing directory of your application, the
> ressources of your application become unreachable.

That sounds about right.

> - As the documentation say "Using '/' as an aliasPath is not
> allowed.", you cannot extend any ressource which is at the root of
> your application.

Right: if you alias /, you are essentially deploying another webapp --
so you should just do that instead.

Tomcat's alias mechanism is intended for use in the case where you
have a bunch of static content in a separate directory and you just
want to be able to serve it through the same webapp without actually
deploying two separate contexts. That's why it works the way it does.

You might be able to build this capability yourself by writing your
own DirContext and specifying it with a <Resources> element within
your <Context> element. See
http://tomcat.apache.org/tomcat-7.0-doc/config/resources.html for details.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7ZMaIACgkQ9CaO5/Lv0PDfsgCgjRhQvBbs0DDkCu4ckHZc2Gtl
ckMAnAuBNfU8UwZyqNfP1JvWX0oDeYAc
=PL/2
-----END PGP SIGNATURE-----

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


Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Sylvain Goulmy <sy...@gmail.com>.
>
> So the effect is that multiple physical directories must be searched for
> a given resource?


Correct.

The alias maps a given path to an external directory.


Ok, that's what i had understood.

 Can you give an example of how you would like it to work?


Here is the description of the EDR (Extended Document Root) mecanism in
Websphere :

Let's assume i have the following application :

- Webapps/
          - MyApplication/
                      - images/
                      - css/
                      - META-INF/
                      - WEB-INF/
                      - index.html

I can define an EDR directory in the configuration of my application so
that the ressource i access are first retrieved from my application and
then in the EDR directory if they don't exist in my application.

- /.../.../.../.../EDR/
                       - images/
                       - index.html

These directories are defined as "extension" of my application and another
important thing is that i can also extend files which are at the root of my
application (as index.html).

After a few more test with Tomcat i understand that :

- You cannot "extend" directory, if you define an external location which
math an existing directory of your application, the ressources of your
application become unreachable.

- As the documentation say "Using '/' as an aliasPath is not allowed.", you
cannot extend any ressource which is at the root of your application.

Things seems clear for me now, please tell if i have missed something.

Thank you in advance for your support.


On Wed, Nov 30, 2011 at 11:53 AM, Pid <pi...@pidster.com> wrote:

> On 29/11/2011 17:47, Sylvain Goulmy wrote:
> > Hi all,
> >
> > I'd like to know it is possible to have equivalent functionality to the
> > "extended document root" provided by the WebSphere product. This feature
> > allows you to define a location outside the webapp to make contribution
> > without having to redeploy the application. This mechanism first checks
> if
> > the resource is present in the application and if not will look for it in
> > the directory extension.
>
> So the effect is that multiple physical directories must be searched for
> a given resource?
>
>
> > I thought that the functionality provided by the new attribute aliases
> for
> > the configuration item <context> would have a similar behavior, but I see
> > another operation. First of all it is not possible to set an alias on the
> > context '/', making it necessary to declare all the directories in which
> > you want to make the contribution. Also when I set an alias for a
> directory
> > present in my webapp, it becomes a priority and files in my webapp are no
> > longer available.
> >
> > Do I understand correctly how this new attribute aliases has to be used ?
>
> The alias maps a given path to an external directory.
>
>
> > Is it possible with Tomcat 7 to set up a mechanism similar to the
> extended
> > document root of Websphere?
>
> Can you give an example of how you would like it to work?
>
>
> p
>
>
>
>
> --
>
> [key:62590808]
>
>

Re: Tomcat 7 - New attribut aliases in the context configuration item

Posted by Pid <pi...@pidster.com>.
On 29/11/2011 17:47, Sylvain Goulmy wrote:
> Hi all,
> 
> I'd like to know it is possible to have equivalent functionality to the
> "extended document root" provided by the WebSphere product. This feature
> allows you to define a location outside the webapp to make contribution
> without having to redeploy the application. This mechanism first checks if
> the resource is present in the application and if not will look for it in
> the directory extension.

So the effect is that multiple physical directories must be searched for
a given resource?


> I thought that the functionality provided by the new attribute aliases for
> the configuration item <context> would have a similar behavior, but I see
> another operation. First of all it is not possible to set an alias on the
> context '/', making it necessary to declare all the directories in which
> you want to make the contribution. Also when I set an alias for a directory
> present in my webapp, it becomes a priority and files in my webapp are no
> longer available.
>
> Do I understand correctly how this new attribute aliases has to be used ?

The alias maps a given path to an external directory.


> Is it possible with Tomcat 7 to set up a mechanism similar to the extended
> document root of Websphere?

Can you give an example of how you would like it to work?


p




-- 

[key:62590808]