You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by David Jencks <da...@yahoo.com> on 2010/09/01 07:59:44 UTC

Re: [Discussion]Add more context level configurations for Tomcat

On Aug 30, 2010, at 11:21 PM, viola lu wrote:

> Hi, dev:
>  I am working on the "Add more context level configurations for Tomcat" jira: https://issues.apache.org/jira/browse/GERONIMO-5557.
> Currently geronimo supports : work-dir, cross-context, cookies(disablecookies), docbase, path(context-path),allowlinking, after going through tomcat 7.0 context configuration page:http://tomcat.apache.org/tomcat-7.0-doc/config/context.html, here I list what I think we should add:
> 
> logEffectiveWebXml
> useHttpOnly
> cacheMaxSize
> cacheObjectMaxSize
> cachingAllowed
> unloadDelay
> 
> Now there are two ways to add these context support:
> add these context configuration as elements one by one in geronimo-tomcat-2.0.1.xsd, and then map them with GBean paramters.
> add all context  configuration as one attribute in geronimo-tomcat-2.0.1.xsd, for example,
> <xs:attribute name="context-options" type="xs:string" use="optional">
> and filter this attribute avoiding any side effect, then map every configuration with corrresponding Gbean paramters.
> 
> The first one make code clear, the second one is easy for end-users to configure context in geronimo-web.xml for web apps.

Hi viola,

It looks to me from the tomcat documentation that context.xml uses the first style, with individual elements for each attribute.  I think making the configuration look more like context.xml would be a good idea, including using the same case for attribute names.

It looks like context.xml also lets you set servlet context parameters.  It its not too much work that might be nice for us to do too.

thanks
david jencks

> 
> Appreciate if you have any comments. 
> 
> -- 
> viola


Re: [Discussion]Add more context level configurations for Tomcat

Posted by viola lu <vi...@gmail.com>.
I think it's better to keep the existing context level attributes (
contextPath, workDir..) as before, new context level attributes in map. Old
geronimo-web.xml configuration way can work without code change, new way
also work. Backward compatibility.
On Sat, Sep 25, 2010 at 4:01 PM, Ivan <xh...@gmail.com> wrote:

> While checking the patch provided by viola, I am planning to use a map to
> hold all the context level attributes, and remove all those duplicate
> parameters from the WebAppContextWrapper constructor, e.g. contextPath,
> workDir ... The so long constructor signature always make the code not so
> gentle, IMO.
> For the deployment plan, I would like to use the schema below, as it makes
> me feel that it is hard to keep the latest tomcat context attributes.
> In the future, I hope that we could remove those Geornimo type
> configurations, like valve-chain ...
> Any comment ? If no objection, I would do these changes.
>
> <xs:element name="context" type="tomcat:contextType" minOccurs="0">
>                 <xs:annotation>
>                     <xs:documentation>
>                         The context element provides the same function as
> used in
>                         Tomcat, it supports context level attributes and
> context
>                         parameters.
>                     </xs:documentation>
>                 </xs:annotation>
> </xs:element>
>
> <xs:complexType name="contextType">
>         <xs:sequence>
>             <xs:element name="parameter" type="tomcat:parameterType"
> minOccurs="0" maxOccurs="unbounded"/>
>         </xs:sequence>
>         <xs:anyAttribute processContents="skip"/>
>     </xs:complexType>
>
>     <xs:complexType name="parameterType">
>         <xs:attribute name="name" type="xs:string" />
>         <xs:attribute name="value" type="xs:string" />
>         <xs:attribute name="override" type="xs:boolean" default="false"/>
>     </xs:complexType>
>
> 2010/9/1 viola lu <vi...@gmail.com>
>
> Thanks David. I will take the first way and add servlet context parameter
>> tool.
>>
>>
>> On Wed, Sep 1, 2010 at 1:59 PM, David Jencks <da...@yahoo.com>wrote:
>>
>>>
>>> On Aug 30, 2010, at 11:21 PM, viola lu wrote:
>>>
>>> Hi, dev:
>>>  I am working on the "Add more context level configurations for Tomcat"
>>> jira: https://issues.apache.org/jira/browse/GERONIMO-5557.
>>> Currently geronimo supports : work-dir, cross-context,
>>> cookies(disablecookies), docbase, path(context-path),allowlinking, after
>>> going through tomcat 7.0 context configuration page:
>>> http://tomcat.apache.org/tomcat-7.0-doc/config/context.html, here I list
>>> what I think we should add:
>>>
>>>
>>>    - logEffectiveWebXml
>>>    - useHttpOnly
>>>    - cacheMaxSize
>>>    - cacheObjectMaxSize
>>>    - cachingAllowed
>>>    - unloadDelay
>>>
>>>
>>> Now there are two ways to add these context support:
>>>
>>>    1. add these context configuration as elements one by one in
>>>    geronimo-tomcat-2.0.1.xsd, and then map them with GBean paramters.
>>>    2. add all context  configuration as one attribute in
>>>    geronimo-tomcat-2.0.1.xsd, for example,
>>>
>>> <xs:attribute name="context-options" type="xs:string" use="optional">
>>> and filter this attribute avoiding any side effect, then map every
>>> configuration with corrresponding Gbean paramters.
>>>
>>> The first one make code clear, the second one is easy for end-users to
>>> configure context in geronimo-web.xml for web apps.
>>>
>>>
>>> Hi viola,
>>>
>>> It looks to me from the tomcat documentation that context.xml uses the
>>> first style, with individual elements for each attribute.  I think making
>>> the configuration look more like context.xml would be a good idea, including
>>> using the same case for attribute names.
>>>
>>> It looks like context.xml also lets you set servlet context parameters.
>>>  It its not too much work that might be nice for us to do too.
>>>
>>> thanks
>>> david jencks
>>>
>>>
>>> Appreciate if you have any comments.
>>>
>>> --
>>> viola
>>>
>>>
>>>
>>
>>
>> --
>> viola
>>
>
>
>
> --
> Ivan
>



-- 
viola

Re: [Discussion]Add more context level configurations for Tomcat

Posted by Ivan <xh...@gmail.com>.
While checking the patch provided by viola, I am planning to use a map to
hold all the context level attributes, and remove all those duplicate
parameters from the WebAppContextWrapper constructor, e.g. contextPath,
workDir ... The so long constructor signature always make the code not so
gentle, IMO.
For the deployment plan, I would like to use the schema below, as it makes
me feel that it is hard to keep the latest tomcat context attributes.
In the future, I hope that we could remove those Geornimo type
configurations, like valve-chain ...
Any comment ? If no objection, I would do these changes.

<xs:element name="context" type="tomcat:contextType" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        The context element provides the same function as
used in
                        Tomcat, it supports context level attributes and
context
                        parameters.
                    </xs:documentation>
                </xs:annotation>
</xs:element>

<xs:complexType name="contextType">
        <xs:sequence>
            <xs:element name="parameter" type="tomcat:parameterType"
minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:anyAttribute processContents="skip"/>
    </xs:complexType>

    <xs:complexType name="parameterType">
        <xs:attribute name="name" type="xs:string" />
        <xs:attribute name="value" type="xs:string" />
        <xs:attribute name="override" type="xs:boolean" default="false"/>
    </xs:complexType>

2010/9/1 viola lu <vi...@gmail.com>

> Thanks David. I will take the first way and add servlet context parameter
> tool.
>
>
> On Wed, Sep 1, 2010 at 1:59 PM, David Jencks <da...@yahoo.com>wrote:
>
>>
>> On Aug 30, 2010, at 11:21 PM, viola lu wrote:
>>
>> Hi, dev:
>>  I am working on the "Add more context level configurations for Tomcat"
>> jira: https://issues.apache.org/jira/browse/GERONIMO-5557.
>> Currently geronimo supports : work-dir, cross-context,
>> cookies(disablecookies), docbase, path(context-path),allowlinking, after
>> going through tomcat 7.0 context configuration page:
>> http://tomcat.apache.org/tomcat-7.0-doc/config/context.html, here I list
>> what I think we should add:
>>
>>
>>    - logEffectiveWebXml
>>    - useHttpOnly
>>    - cacheMaxSize
>>    - cacheObjectMaxSize
>>    - cachingAllowed
>>    - unloadDelay
>>
>>
>> Now there are two ways to add these context support:
>>
>>    1. add these context configuration as elements one by one in
>>    geronimo-tomcat-2.0.1.xsd, and then map them with GBean paramters.
>>    2. add all context  configuration as one attribute in
>>    geronimo-tomcat-2.0.1.xsd, for example,
>>
>> <xs:attribute name="context-options" type="xs:string" use="optional">
>> and filter this attribute avoiding any side effect, then map every
>> configuration with corrresponding Gbean paramters.
>>
>> The first one make code clear, the second one is easy for end-users to
>> configure context in geronimo-web.xml for web apps.
>>
>>
>> Hi viola,
>>
>> It looks to me from the tomcat documentation that context.xml uses the
>> first style, with individual elements for each attribute.  I think making
>> the configuration look more like context.xml would be a good idea, including
>> using the same case for attribute names.
>>
>> It looks like context.xml also lets you set servlet context parameters.
>>  It its not too much work that might be nice for us to do too.
>>
>> thanks
>> david jencks
>>
>>
>> Appreciate if you have any comments.
>>
>> --
>> viola
>>
>>
>>
>
>
> --
> viola
>



-- 
Ivan

Re: [Discussion]Add more context level configurations for Tomcat

Posted by viola lu <vi...@gmail.com>.
Thanks David. I will take the first way and add servlet context parameter
tool.

On Wed, Sep 1, 2010 at 1:59 PM, David Jencks <da...@yahoo.com> wrote:

>
> On Aug 30, 2010, at 11:21 PM, viola lu wrote:
>
> Hi, dev:
>  I am working on the "Add more context level configurations for Tomcat"
> jira: https://issues.apache.org/jira/browse/GERONIMO-5557.
> Currently geronimo supports : work-dir, cross-context,
> cookies(disablecookies), docbase, path(context-path),allowlinking, after
> going through tomcat 7.0 context configuration page:
> http://tomcat.apache.org/tomcat-7.0-doc/config/context.html, here I list
> what I think we should add:
>
>
>    - logEffectiveWebXml
>    - useHttpOnly
>    - cacheMaxSize
>    - cacheObjectMaxSize
>    - cachingAllowed
>    - unloadDelay
>
>
> Now there are two ways to add these context support:
>
>    1. add these context configuration as elements one by one in
>    geronimo-tomcat-2.0.1.xsd, and then map them with GBean paramters.
>    2. add all context  configuration as one attribute in
>    geronimo-tomcat-2.0.1.xsd, for example,
>
> <xs:attribute name="context-options" type="xs:string" use="optional">
> and filter this attribute avoiding any side effect, then map every
> configuration with corrresponding Gbean paramters.
>
> The first one make code clear, the second one is easy for end-users to
> configure context in geronimo-web.xml for web apps.
>
>
> Hi viola,
>
> It looks to me from the tomcat documentation that context.xml uses the
> first style, with individual elements for each attribute.  I think making
> the configuration look more like context.xml would be a good idea, including
> using the same case for attribute names.
>
> It looks like context.xml also lets you set servlet context parameters.  It
> its not too much work that might be nice for us to do too.
>
> thanks
> david jencks
>
>
> Appreciate if you have any comments.
>
> --
> viola
>
>
>


-- 
viola