On Thu, 7 Mar 2002, Sankaranarayanan Ganapathy wrote:

> Date: Thu, 7 Mar 2002 12:23:15 -0800
> From: Sankaranarayanan Ganapathy <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Making Embedded tomcat work off tomcat config files
>
> Hi All,
>
> I am embedding tomcat in my application , but I dont want to deal with
> the configuration aspects of tomcat. I see that embedded tomcat requires
> that we set the configuration information programatically (like ports,
> connectors, contexts) etc. Is there a way to make an embedded tomcat
> read this information from the configuration files!
>

Simplest thing would be to call the main() method of
org.apache.catalina.startup.Bootstrap yourself -- that's all that the
catalina.sh/catalina.bat scripts do.  It will then parse server.xml and
create the hierarchy.

> Alos that the org.apache.catalina.startup.Catalina uses a SAX parser and
> adds actions and builds a object hierarchy . Alternatively Is there a
> single tomcat api that we could call to build this object hierarchy?
>

That's what the Embedded class is for, but you said you didn't want to
deal with the configuration complexity yourself.  Tomcat's standard
approach is to do an XML parse of $CATALINA_HOME/conf/server.xml and
create the corresponding Catalina components in response to interesting
SAX events.  Without reading server.xml, it's up to you to build the
object hierarchy yourself, which Embedded can help you with.

Note that you're going to need an XML parser anyway, because it's used for
reading web.xml files, tag library descriptors, and JSP pages in XML
syntax.

> Any help will be greatly appreciated !
>
> Thanx in advance
> Ganesh
>

Craig


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to