Back Forum Reply New

Catching BeanCreationException on an autowired struts action

Hello,

For a web application, I'm using Struts 2 and Spring 2.5.
I defined a struts action which reffered a business service.
this service is autowired in the action.Code:
lt;bean id=quot;logElfServicequot; class=quot;...LogElfServiceImplquot; init-method=quot;validateParametersquot; scope=quot;prototypequot; gt;   lt;constructor-arg value=quot;${elf.server.host}quot;gt;lt;/constructor-arggt;   lt;constructor-arg value=quot;${elf.server.port}quot;gt;lt;/constructor-arggt;
lt;/beangt;
The validateParameters method is used as init method and can throw an exception in case of invalid parameters.

I added a struts interceptor to catch all exceptions and redirect them in an error page. Unfortunately, I can't catch this exception. My stuts global-exception-mapping doesn't nor.

Is there a way to catch init-method exceptions on autowired bean ?

thanks,

Emmanuel.
¥
Back Forum Reply New