You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stephen Munro <st...@gmail.com> on 2011/07/15 21:52:35 UTC

Tomcat 7 generated web.xml

I'm looking for details on how to get the generated web.xml after all the
annotations have been processed.  I had watched a video
on this feature and as I understand it, once the annotations have been
processed, it's possible to log the web.xml generated from it and
use it for production, which means you can disable annotations thus
improving performance. How do I do this?

-- 
Warmest Regards,

Stephen Munro

Re: Tomcat 7 generated web.xml

Posted by Pid <pi...@pidster.com>.
On 15/07/2011 22:38, Stephen Munro wrote:
> No, that wasn't the way it was pitched. The video was from springsource and
> a Mark Thomas was discussing the feature in question (
> http://www.youtube.com/watch?v=HSPo8k6DbTs&feature=related). 

Mark is a Tomcat committer.

He did say that
> this feature was good for ensuring nothing was enabled accidentally through
> web-fragments and that the log feature would help sanity check the web-app
> configuration. 

That is very true.

However, he did state it was a good way for improving performance.

Not all optimisations are aimed at production.

This was purely out of my own curiosity and I've not looked
> into Tomcat much and it seemed (to me at least) worth asking about. As you
> seemed to have implied in your comment, unless the app is rebooted on a
> regular basis, it may not be worth dumping the in memory copy to a generated
> web.xml file.

Indeed.


p


> On 15 July 2011 22:28, Pid <pi...@pidster.com> wrote:
> 
>> On 15/07/2011 22:25, Stephen Munro wrote:
>>> Yeah, you may be right out it's usefulness, but on the video I watched,
>> it
>>> was being pitched as a performance boost if you had a massive web app
>> (with
>>> annotations and web-fragments). So the use case would be, develop the app
>>> with annotations enabled and in production, switch them off and use the
>>> master (generated) web.xml, that's what my understanding of it was. So,
>> with
>>> that in mind, I'd have thought a web.xml file would have been created and
>>> that could be checked into version control without the user having to do
>>> anything.
>>
>> Does the video describe an app which is rebooted frequently in production?
>>
>>
>> p
>>
>>
>>> This may not be what had been envisioned for it's primary use, it just
>>> struck me as a nice feature to have.
>>>
>>> On 15 July 2011 22:18, Jesse Farinacci <ji...@gmail.com> wrote:
>>>
>>>> Greetings,
>>>>
>>>> On Fri, Jul 15, 2011 at 5:10 PM, Stephen Munro
>>>> <st...@gmail.com> wrote:
>>>>> Thanks for the quick reply! I've got it working, so thanks. I'm a
>> little
>>>>> curious why the web-app structure is dumped directly to the logs rather
>>>> than
>>>>> have it written to a .xml for convenience say...web-generated.xml?
>>>>
>>>> Great! The configuration option name has "log" right in it. I wouldn't
>>>> expect it to do anything other than log the effective web.xml. Having
>>>> this effective web.xml output to a special file seems of limited
>>>> value, you can simply copy and paste in the rare event that you
>>>> actually require it.
>>>>
>>>> -Jesse
>>>>
>>>> --
>>>> There are 10 types of people in this world, those
>>>> that can read binary and those that can not.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>
>>>
>>
>>
>>
> 
> 



Re: Tomcat 7 generated web.xml

Posted by Stephen Munro <st...@gmail.com>.
No, that wasn't the way it was pitched. The video was from springsource and
a Mark Thomas was discussing the feature in question (
http://www.youtube.com/watch?v=HSPo8k6DbTs&feature=related). He did say that
this feature was good for ensuring nothing was enabled accidentally through
web-fragments and that the log feature would help sanity check the web-app
configuration. However, he did state it was a good way for improving
performance.  This was purely out of my own curiosity and I've not looked
into Tomcat much and it seemed (to me at least) worth asking about. As you
seemed to have implied in your comment, unless the app is rebooted on a
regular basis, it may not be worth dumping the in memory copy to a generated
web.xml file.



On 15 July 2011 22:28, Pid <pi...@pidster.com> wrote:

> On 15/07/2011 22:25, Stephen Munro wrote:
> > Yeah, you may be right out it's usefulness, but on the video I watched,
> it
> > was being pitched as a performance boost if you had a massive web app
> (with
> > annotations and web-fragments). So the use case would be, develop the app
> > with annotations enabled and in production, switch them off and use the
> > master (generated) web.xml, that's what my understanding of it was. So,
> with
> > that in mind, I'd have thought a web.xml file would have been created and
> > that could be checked into version control without the user having to do
> > anything.
>
> Does the video describe an app which is rebooted frequently in production?
>
>
> p
>
>
> > This may not be what had been envisioned for it's primary use, it just
> > struck me as a nice feature to have.
> >
> > On 15 July 2011 22:18, Jesse Farinacci <ji...@gmail.com> wrote:
> >
> >> Greetings,
> >>
> >> On Fri, Jul 15, 2011 at 5:10 PM, Stephen Munro
> >> <st...@gmail.com> wrote:
> >>> Thanks for the quick reply! I've got it working, so thanks. I'm a
> little
> >>> curious why the web-app structure is dumped directly to the logs rather
> >> than
> >>> have it written to a .xml for convenience say...web-generated.xml?
> >>
> >> Great! The configuration option name has "log" right in it. I wouldn't
> >> expect it to do anything other than log the effective web.xml. Having
> >> this effective web.xml output to a special file seems of limited
> >> value, you can simply copy and paste in the rare event that you
> >> actually require it.
> >>
> >> -Jesse
> >>
> >> --
> >> There are 10 types of people in this world, those
> >> that can read binary and those that can not.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >
> >
>
>
>


-- 
Warmest Regards,

Stephen Munro

Re: Tomcat 7 generated web.xml

Posted by Pid <pi...@pidster.com>.
On 15/07/2011 22:25, Stephen Munro wrote:
> Yeah, you may be right out it's usefulness, but on the video I watched, it
> was being pitched as a performance boost if you had a massive web app (with
> annotations and web-fragments). So the use case would be, develop the app
> with annotations enabled and in production, switch them off and use the
> master (generated) web.xml, that's what my understanding of it was. So, with
> that in mind, I'd have thought a web.xml file would have been created and
> that could be checked into version control without the user having to do
> anything.

Does the video describe an app which is rebooted frequently in production?


p


> This may not be what had been envisioned for it's primary use, it just
> struck me as a nice feature to have.
> 
> On 15 July 2011 22:18, Jesse Farinacci <ji...@gmail.com> wrote:
> 
>> Greetings,
>>
>> On Fri, Jul 15, 2011 at 5:10 PM, Stephen Munro
>> <st...@gmail.com> wrote:
>>> Thanks for the quick reply! I've got it working, so thanks. I'm a little
>>> curious why the web-app structure is dumped directly to the logs rather
>> than
>>> have it written to a .xml for convenience say...web-generated.xml?
>>
>> Great! The configuration option name has "log" right in it. I wouldn't
>> expect it to do anything other than log the effective web.xml. Having
>> this effective web.xml output to a special file seems of limited
>> value, you can simply copy and paste in the rare event that you
>> actually require it.
>>
>> -Jesse
>>
>> --
>> There are 10 types of people in this world, those
>> that can read binary and those that can not.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 



Re: Tomcat 7 generated web.xml

Posted by Stephen Munro <st...@gmail.com>.
Yeah, you may be right out it's usefulness, but on the video I watched, it
was being pitched as a performance boost if you had a massive web app (with
annotations and web-fragments). So the use case would be, develop the app
with annotations enabled and in production, switch them off and use the
master (generated) web.xml, that's what my understanding of it was. So, with
that in mind, I'd have thought a web.xml file would have been created and
that could be checked into version control without the user having to do
anything.

This may not be what had been envisioned for it's primary use, it just
struck me as a nice feature to have.

On 15 July 2011 22:18, Jesse Farinacci <ji...@gmail.com> wrote:

> Greetings,
>
> On Fri, Jul 15, 2011 at 5:10 PM, Stephen Munro
> <st...@gmail.com> wrote:
> > Thanks for the quick reply! I've got it working, so thanks. I'm a little
> > curious why the web-app structure is dumped directly to the logs rather
> than
> > have it written to a .xml for convenience say...web-generated.xml?
>
> Great! The configuration option name has "log" right in it. I wouldn't
> expect it to do anything other than log the effective web.xml. Having
> this effective web.xml output to a special file seems of limited
> value, you can simply copy and paste in the rare event that you
> actually require it.
>
> -Jesse
>
> --
> There are 10 types of people in this world, those
> that can read binary and those that can not.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Warmest Regards,

Stephen Munro

Re: Tomcat 7 generated web.xml

Posted by Jesse Farinacci <ji...@gmail.com>.
Greetings,

On Fri, Jul 15, 2011 at 5:10 PM, Stephen Munro
<st...@gmail.com> wrote:
> Thanks for the quick reply! I've got it working, so thanks. I'm a little
> curious why the web-app structure is dumped directly to the logs rather than
> have it written to a .xml for convenience say...web-generated.xml?

Great! The configuration option name has "log" right in it. I wouldn't
expect it to do anything other than log the effective web.xml. Having
this effective web.xml output to a special file seems of limited
value, you can simply copy and paste in the rare event that you
actually require it.

-Jesse

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

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


Re: Tomcat 7 generated web.xml

Posted by Stephen Munro <st...@gmail.com>.
Thanks for the quick reply! I've got it working, so thanks. I'm a little
curious why the web-app structure is dumped directly to the logs rather than
have it written to a .xml for convenience say...web-generated.xml?

On 15 July 2011 21:04, Jesse Farinacci <ji...@gmail.com> wrote:

> Greetings,
>
> On Fri, Jul 15, 2011 at 3:52 PM, Stephen Munro
> <st...@gmail.com> wrote:
> > I'm looking for details on how to get the generated web.xml after all the
> > annotations have been processed.
>
> See http://tomcat.apache.org/tomcat-7.0-doc/config/context.html and
> look for logEffectiveWebXml.
>
> -Jesse
>
> --
> There are 10 types of people in this world, those
> that can read binary and those that can not.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Warmest Regards,

Stephen Munro

Re: Tomcat 7 generated web.xml

Posted by Jesse Farinacci <ji...@gmail.com>.
Greetings,

On Fri, Jul 15, 2011 at 3:52 PM, Stephen Munro
<st...@gmail.com> wrote:
> I'm looking for details on how to get the generated web.xml after all the
> annotations have been processed.

See http://tomcat.apache.org/tomcat-7.0-doc/config/context.html and
look for logEffectiveWebXml.

-Jesse

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

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