Property placeholders from servlet context?

View: New views
2 Messages — Rating Filter:   Alert me  

Property placeholders from servlet context?

by fluffyland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm trying to set up a simple cocoon 2.2 web application that gets its context-path from the servlet context.  I would have thought this would be a simple thing to do but I haven't figured it out yet.

I've searched the mailing list archives and the cocoon website for answers without any luck.

I've tried writing a class that implements PropertyProvider and ServletContextAware and loaded it into both the applicationContext.xml and the servlet service block's xml file and Spring passes the servlet context to it as per ServletContextAware but the Cocoon Spring Configurator never gets the Properties out of it.

Is http://cocoon.apache.org/subprojects/configuration/1.0/spring-configurator/1.0/1310_1_1.html accurate? Does it check for PropertyProviders?

Do I have to do something else to get the Cocoon Spring Configurator to get it to consult my PropertyProvider like refer to it in the <configurator:settings> tag in applicationContext.xml?

Is there a better way of referring to context init-params in a block's property placeholder xml configuration files?

Any help would be appreciated.

--
Stephen Rosman

Re: Property placeholders from servlet context?

by Stephen Rosman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Do I have to do something else to get the Cocoon Spring Configurator to get
> it to consult my PropertyProvider like refer to it in the
> <configurator:settings> tag in applicationContext.xml?

You have to name the bean with a role PropertyProvider.ROLE - as
mentioned in the documentation at
http://cocoon.apache.org/subprojects/configuration/1.0/configuration-api/1.0/apidocs/org/apache/cocoon/configuration/PropertyProvider.html

> Is there a better way of referring to context init-params in a block's
> property placeholder xml configuration files?

It'd still be better to do it in configuration rather than have to
have a class bridging the servlet context and the spring/cocoon
configuration...

--
Stephen Rosman

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price