mschuerig
Sep 6th, 2004, 04:57 AM
I have a bean, MyDigester, that internally uses a Digester to create objects from an XML file. The digester rules are not defined programmatically, but rather in a file /WEB-INF/mydigester.xml.
MyDigester's ctor takes as a single argument a URL to the digester rules. Thus, in the bean definition, I'd like to write something like this
<bean
id="mydigester"
class="...MyDigester"
singleton="false">
<constructor-arg><value>/WEB-INF/mydigester.xml</value></constructor-arg>
</bean>
Presumably the value string is automatically converted to a URL, but unfortunately, java.net.URL seems to accept only absolute URLs.
Programmatically I can get at the URL with
appctx.getResource("/WEB-INF/mydigester.xml").getURL(), but I don't see a way to do it declaratively, which I'd prefer obviously.
Michael
MyDigester's ctor takes as a single argument a URL to the digester rules. Thus, in the bean definition, I'd like to write something like this
<bean
id="mydigester"
class="...MyDigester"
singleton="false">
<constructor-arg><value>/WEB-INF/mydigester.xml</value></constructor-arg>
</bean>
Presumably the value string is automatically converted to a URL, but unfortunately, java.net.URL seems to accept only absolute URLs.
Programmatically I can get at the URL with
appctx.getResource("/WEB-INF/mydigester.xml").getURL(), but I don't see a way to do it declaratively, which I'd prefer obviously.
Michael