commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@apache.org>
Subject Re: Using CatalogManager in Struts
Date Fri, 09 Dec 2005 18:33:15 GMT
On 12/9/05, Upkar Saimbi <usaimbi@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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message