You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Craig McClanahan <cr...@apache.org> on 2005/12/09 19:33:15 UTC

Re: Using CatalogManager in Struts

On 12/9/05, Upkar Saimbi <us...@cy-nap.com> wrote:
>
> Hello, I'd like to be able to use local versions of the struts DTDs -
> configuring them within a Catalog xml file. I need to use something
> called a resolver with my parser but I haven't the foggiest idea how I
> can do this. I have my Catalog.properties file and catalog.xml files set
> up in my WEB-INF/classes webapp directory, I just don't know how to get
> struts to refer to it.


Struts does *exactly* the same thing when it parses your
struts-config.xmlfiles, so it would be helpful for you to see how
that's done (using Commons
Digester).  Check out the initConfigDigester() method of
org.apache.struts.action.ActionServlet, and notice how it uses the
register() method of the Digester instance to register local copies of the
Struts DTDs.

Internally, what's going on is a string like
"/org/apache/struts/resources/struts_config_1_2.dtd" (which points at a
resource file included in struts.jar) is being turned into a URL by calling
ServletContext.getResource() -- exactly what you need to gain access to
anything stored under WEB-INF/classes or WEB-INF/lib.


Please help....
>
> Thanks.
>
> Upkar Saimbi


Craig McClanahan