Re: Offline generation of effective web.xml

2012-09-12 Thread Violeta Georgieva
Thanks for the starting point.
I'm starting to look at the code and when I have the first results I'll
write to the dev list.
Is that OK?

2012/9/11 Konstantin Kolinko knst.koli...@gmail.com

 2012/9/11 Violeta Georgieva miles...@gmail.com:
  It would be very useful if I can provide this as part of the build
  infrastructure for example.
  If you can give me a hint from where to start I may try to provide a
 patch
  for 8.0.x? Wdyt?
 
 
  2012/9/11 Mark Thomas ma...@apache.org
 
   Violeta Georgieva violet...@apache.org wrote:
 
  Hi,
  
  I do know that if I provide logEffectiveWebXml=true in my context.xml
  then the effective web.xml will be logged in the log files during
  application start.
  
  Is there a way (library etc.) that I can use to generated effective
  web.xml
  offline i.e. without starting the application.
  
  Thanks in advance.
  Violeta
 
  No, although I am beginning to think about refactoring the web.xml
  scanning for 8.0.x for other reasons but any such refactoring should
 make
  this trivial.
 
  I haven't got much further than it would be useful if... so it may
 turn
  out to be impractical.
 

 1. Logging the effective web.xml is performed in
 o.a.c.startup.ContextConfig.
 Search for
 org.apache.tomcat.util.scan.Constants.MERGED_WEB_XML

 2. I would like to remove this MERGED_WEB_XML
 from future versions. Instead of re-parsing web.xml Jasper would
 better be using Servlet API to query needed features.

 IIRC, actually Jasper does not need much: just specification version
 and jsp-config.

 A downside is that Jasper has to be used stand-alone as JspC. So it
 should still be able to parse web.xml. So either
 a) refactor the whole parsing of web.xml, moving it into reusable
 component (like Mark wrote),  or
 b) keep the current parsing code in Jasper and make its own objects
 implement relevant parts of Servlet API.

 This is filed as BZ53737. The first attempt was in r1377511
 (+discussion), reverted in r1377539.

 https://issues.apache.org/bugzilla/show_bug.cgi?id=53737
 http://markmail.org/message/dyuyuuglunuy4qej
 http://markmail.org/message/kknk2xh7wdcznsv7

 3. Note, that currently this merged web xml may miss some features.

 - It may change the order of elements vs. original web.xml. There are
 a number of elements whose order is not important. Tomcat uses HashMap
 for those, so their order may change randomly from run to run.

 - It may miss some elements from original web.xml, that are not parsed
 by Tomcat. Such as descriptions.

 Several weeks ago I went through the code, correcting some typos in
 element names and wrong order of elements.

 Best regards,
 Konstantin Kolinko

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




Re: Offline generation of effective web.xml

2012-09-11 Thread Mark Thomas
Violeta Georgieva violet...@apache.org wrote:

Hi,

I do know that if I provide logEffectiveWebXml=true in my context.xml
then the effective web.xml will be logged in the log files during
application start.

Is there a way (library etc.) that I can use to generated effective
web.xml
offline i.e. without starting the application.

Thanks in advance.
Violeta

No, although I am beginning to think about refactoring the web.xml scanning for 
8.0.x for other reasons but any such refactoring should make this trivial.

I haven't got much further than it would be useful if... so it may turn out 
to be impractical.

Mark

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



Re: Offline generation of effective web.xml

2012-09-11 Thread Violeta Georgieva
It would be very useful if I can provide this as part of the build
infrastructure for example.
If you can give me a hint from where to start I may try to provide a patch
for 8.0.x? Wdyt?


2012/9/11 Mark Thomas ma...@apache.org

  Violeta Georgieva violet...@apache.org wrote:

 Hi,
 
 I do know that if I provide logEffectiveWebXml=true in my context.xml
 then the effective web.xml will be logged in the log files during
 application start.
 
 Is there a way (library etc.) that I can use to generated effective
 web.xml
 offline i.e. without starting the application.
 
 Thanks in advance.
 Violeta

 No, although I am beginning to think about refactoring the web.xml
 scanning for 8.0.x for other reasons but any such refactoring should make
 this trivial.

 I haven't got much further than it would be useful if... so it may turn
 out to be impractical.

 Mark

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




Re: Offline generation of effective web.xml

2012-09-11 Thread Mark Thomas


Violeta Georgieva miles...@gmail.com wrote:

It would be very useful if I can provide this as part of the build
infrastructure for example.
If you can give me a hint from where to start I may try to provide a
patch
for 8.0.x? Wdyt?

There is going to need to be a lot of refactoring for this. I'm not sure if a 
patch is the right way to go. Neither am I sure what the best way is. Maybe a 
git branch (e.g. on github) with a series of patches? I don't have enough 
experience with the git-svn integration to know if that would be easier or 
harder to deal with.

In terms of what needs to be done:
- the end result needs to be useable by both Jasper and Catalina - that pretty 
much means a new package and JAR under o.a.tomcat
- Jasper cannot depend on Catalina (hence why everything needs to move packages)
- the things that need to move to this new package
   - the web.xml parsing (i.e.the digester)
   - the annotation scanning
   - the SCI scanning
   - the merging
   - the object representation of web.xml
- switch everything over to the new implementation

This is a big change but most of it is just moving stuff around. It isn't 
changing functionality (well it is - JspC would process fragments which it 
doesn't currently for example but all the functional changes would be 
improvements of this nature)

I suggest making a proposal to the dev list. If that gets support, I'd be happy 
to help with this. I suspect in that case a series of svn moves and patches 
would follow.

Mark

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



Re: Offline generation of effective web.xml

2012-09-11 Thread Konstantin Kolinko
2012/9/11 Violeta Georgieva miles...@gmail.com:
 It would be very useful if I can provide this as part of the build
 infrastructure for example.
 If you can give me a hint from where to start I may try to provide a patch
 for 8.0.x? Wdyt?


 2012/9/11 Mark Thomas ma...@apache.org

  Violeta Georgieva violet...@apache.org wrote:

 Hi,
 
 I do know that if I provide logEffectiveWebXml=true in my context.xml
 then the effective web.xml will be logged in the log files during
 application start.
 
 Is there a way (library etc.) that I can use to generated effective
 web.xml
 offline i.e. without starting the application.
 
 Thanks in advance.
 Violeta

 No, although I am beginning to think about refactoring the web.xml
 scanning for 8.0.x for other reasons but any such refactoring should make
 this trivial.

 I haven't got much further than it would be useful if... so it may turn
 out to be impractical.


1. Logging the effective web.xml is performed in
o.a.c.startup.ContextConfig.
Search for
org.apache.tomcat.util.scan.Constants.MERGED_WEB_XML

2. I would like to remove this MERGED_WEB_XML
from future versions. Instead of re-parsing web.xml Jasper would
better be using Servlet API to query needed features.

IIRC, actually Jasper does not need much: just specification version
and jsp-config.

A downside is that Jasper has to be used stand-alone as JspC. So it
should still be able to parse web.xml. So either
a) refactor the whole parsing of web.xml, moving it into reusable
component (like Mark wrote),  or
b) keep the current parsing code in Jasper and make its own objects
implement relevant parts of Servlet API.

This is filed as BZ53737. The first attempt was in r1377511
(+discussion), reverted in r1377539.

https://issues.apache.org/bugzilla/show_bug.cgi?id=53737
http://markmail.org/message/dyuyuuglunuy4qej
http://markmail.org/message/kknk2xh7wdcznsv7

3. Note, that currently this merged web xml may miss some features.

- It may change the order of elements vs. original web.xml. There are
a number of elements whose order is not important. Tomcat uses HashMap
for those, so their order may change randomly from run to run.

- It may miss some elements from original web.xml, that are not parsed
by Tomcat. Such as descriptions.

Several weeks ago I went through the code, correcting some typos in
element names and wrong order of elements.

Best regards,
Konstantin Kolinko

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