Guice has a concept of providers, I cant remember if spring has the
same. You could in that provider ask what kind of mode wicket were in
and then return the appropriate service. Im not sure this is a desired
way togo since it will impact performance in production.. However
resource filtering in maven as IIja writes are better and does not
impact production performance.

regards Nino

2010/1/7 Liam Clarke-Hutchinson <l...@steelsky.co.nz>:
> Hi all,
>
> This is probably more of a Spring question than a Wicket question, but I'm
> asking here in the hopes that someone else has done this before. Basically,
> we have a page that uses the @SpringBean annotation to inject a credit card
> validation service. At the moment, when we're developing, it's injecting the
> actual service, that then goes off to our card processor and validates the
> card etc. For integration testing etc. I want to avoid this, so I've created
> a simple implementation of the validation service that always returns true.
> Question I have, is how can I provide this bean instead of the real bean,
> based on the value of WebApplication.getConfigurationType()?
>
> The obvious solution for me would be to do it in the initialization of our
> WicketApplication - we already have a "if we're in development mode" section
> where we output component paths and turn on request logging and session size
> recording etc. is there a way I can programmatically provide my bean at this
> point? Or am I going about this entirely the wrong way?
>
> Many thanks for any advice offered,
>
> Regards,
>
> Liam Clarke
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to