Hi Wang,
What Michael Clark pointed out about configuring a ContextLoaderPlugIn is correct. Doing so will solve your NullPointerException issue; however, this will not help you with your initial problem.
The bad news for you is that my earlier assumption was correct: you can not directly use the SpringWebFlowExceptionResolver in conjunction with Struts.
The reason is that SpringWebFlowExceptionResolver is a HandlerExceptionResolver which is called by Spring's DispatcherServlet in its processHandlerException() method. Since you are using Struts, a Struts ActionServlet is responsible for handling your request. Thus any exceptions thrown will never be handled by a HandlerExceptionResolver and must therefore be handled by the Struts framework (for example, by implementing a custom Struts ExceptionHandler as I mentioned earlier).
Another possible option would be to override the execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) method of SWF's FlowAction and add a try-catch block around the calls into the SWF framework code. You could then decide how to handle the exception yourself, perhaps in a manner similar to the SpringWebFlowExceptionResolver implementation.
Hope this helps!
And if you develop a custom exception handling solution for use with Struts+SWF, please post it back here in the forum or on Jira, as I'm sure the rest of the community would appreciate it.
cheers,
Sam



Reply With Quote

