You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Kjome <ho...@visi.com> on 2003/05/01 23:39:26 UTC

RE: Upgrade your webapps easily HOW-TO (requires ant/manager app practice)

Might I suggest that you use a SAX parser rather than the DOM to parse 
things.  Unless you need to store the document and do a lot of 
manipulations with the document sitting in memory and then return that 
document to something, SAX is the way to go.  It is much faster and doesn't 
use much memory.  Of course the disadvantage of SAX is that you don't have 
a document left over to manipulate and return, but I doubt that is what you 
need for this, right?

Jake

At 10:48 PM 5/1/2003 +0200, you wrote:
>Hi Yoav,
>
>ad 2.) I now use a DOM object to parse the XML much cleaner.
>However, now I've got two functions which should be moved into a Xml
>library (getDocumentBuilder() and getAttributeValue()).
>Do you know a good place where to move them?
>getDocumentBuilder is also used at WebDavServlet, this could be
>consolidated as well.
>
>The updated version can be found at the same location as before:
>http://www.fwd.at/tomcat/upgrade-webapps-howto.html
>
>ad 3.) thx, but first I have to get TC 5.0.1 build running :(.
>
>thx alot
>Johannes
>
>
>
>
>"Shapira, Yoav" <Yo...@mpi.com>
>01.05.2003 20:35
>Please respond to
>"Tomcat Users List" <to...@jakarta.apache.org>
>
>
>To
>"Tomcat Users List" <to...@jakarta.apache.org>
>cc
>
>Subject
>RE: Upgrade your webapps easily HOW-TO (requires ant/manager app practice)
>
>
>
>
>
>
>
>Howdy,
>
> >1.) I'm about to integrate the changes into TC 5.0.1, but am unable to
> >build it due to a commons-el problem. Should I post build questions for
>TC
> >5.0.1 here or at the tomcat-dev list?
>
>That specific question I think belongs in tomcat dev as you've been
>doing.
>
> >2.) I'm currently reading the whole context.xml-InputStream and use
> >.indexOf to find the attribute I need.
> >Is there another more elegant approach using an apache-commons library?
>
>Yeah, I saw that code, and it is ugly ;)  You don't want to do a
>digest.parse(stream) because that'll trigger digester rules.  You could
>just construct a DOM Document quickly using the default XML parser.
>
> >3.) How do I make sure the overrideDocBase-enhancement makes eventually
> >its way into TC 5.0.x, so I can rely on them?
>
>Open a bugzilla enhancement request for 5.0.1.  Attach your patch for
>5.0.1 to the bugzilla item.
>
>By the way, with regards to your preference of using an
>ExtendedHostDeployer rather than patching the StandardHostDeployer: I
>like it and agree with it.  I don't think the host deployer is
>configurable right now.  We could make it configurable however...
>
>Yoav Shapira
>Millennium ChemInformatics
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary and/or privileged.  This e-mail is intended only for the
>individual(s) to whom it is addressed, and may not be saved, copied,
>printed, disclosed or used by anyone else.  If you are not the(an)
>intended recipient, please immediately delete this e-mail from your
>computer system and notify the sender.  Thank you.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

RE: Upgrade your webapps easily HOW-TO (requires ant/manager app practice)

Posted by Johannes Fiala <to...@fwd.at>.
Hi Jacob,

I think this is way better than the current DOM based approach, maybe 
context.xml will become much bigger in the future, so it really pays of 
not to parse it completely.

Do you know a working example of parsing for an attribute somewhere at the 
TC 5.0.1 source or somewhere else?
I think I'd have to use a separate class for implementing the parsing 
action, where should this be stored? Is there any guideline on this 
available?

thx
Johannes




Jacob Kjome <ho...@visi.com> 
01.05.2003 23:39
Please respond to
"Tomcat Users List" <to...@jakarta.apache.org>


To
"Tomcat Users List" <to...@jakarta.apache.org>
cc

Subject
RE: Upgrade your webapps easily HOW-TO (requires ant/manager  app 
practice)







Might I suggest that you use a SAX parser rather than the DOM to parse 
things.  Unless you need to store the document and do a lot of 
manipulations with the document sitting in memory and then return that 
document to something, SAX is the way to go.  It is much faster and 
doesn't 
use much memory.  Of course the disadvantage of SAX is that you don't have 

a document left over to manipulate and return, but I doubt that is what 
you 
need for this, right?

Jake

At 10:48 PM 5/1/2003 +0200, you wrote:
>Hi Yoav,
>
>ad 2.) I now use a DOM object to parse the XML much cleaner.
>However, now I've got two functions which should be moved into a Xml
>library (getDocumentBuilder() and getAttributeValue()).
>Do you know a good place where to move them?
>getDocumentBuilder is also used at WebDavServlet, this could be
>consolidated as well.
>
>The updated version can be found at the same location as before:
>http://www.fwd.at/tomcat/upgrade-webapps-howto.html
>
>ad 3.) thx, but first I have to get TC 5.0.1 build running :(.
>
>thx alot
>Johannes
>
>
>
>
>"Shapira, Yoav" <Yo...@mpi.com>
>01.05.2003 20:35
>Please respond to
>"Tomcat Users List" <to...@jakarta.apache.org>
>
>
>To
>"Tomcat Users List" <to...@jakarta.apache.org>
>cc
>
>Subject
>RE: Upgrade your webapps easily HOW-TO (requires ant/manager app 
practice)
>
>
>
>
>
>
>
>Howdy,
>
> >1.) I'm about to integrate the changes into TC 5.0.1, but am unable to
> >build it due to a commons-el problem. Should I post build questions for
>TC
> >5.0.1 here or at the tomcat-dev list?
>
>That specific question I think belongs in tomcat dev as you've been
>doing.
>
> >2.) I'm currently reading the whole context.xml-InputStream and use
> >.indexOf to find the attribute I need.
> >Is there another more elegant approach using an apache-commons library?
>
>Yeah, I saw that code, and it is ugly ;)  You don't want to do a
>digest.parse(stream) because that'll trigger digester rules.  You could
>just construct a DOM Document quickly using the default XML parser.
>
> >3.) How do I make sure the overrideDocBase-enhancement makes eventually
> >its way into TC 5.0.x, so I can rely on them?
>
>Open a bugzilla enhancement request for 5.0.1.  Attach your patch for
>5.0.1 to the bugzilla item.
>
>By the way, with regards to your preference of using an
>ExtendedHostDeployer rather than patching the StandardHostDeployer: I
>like it and agree with it.  I don't think the host deployer is
>configurable right now.  We could make it configurable however...
>
>Yoav Shapira
>Millennium ChemInformatics
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary and/or privileged.  This e-mail is intended only for the
>individual(s) to whom it is addressed, and may not be saved, copied,
>printed, disclosed or used by anyone else.  If you are not the(an)
>intended recipient, please immediately delete this e-mail from your
>computer system and notify the sender.  Thank you.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org