I have an Action class( see BookAction below ), which calls 'SchedulingDelegate.updateRotation()' inside the 'try' block. The call to 'updateRotation()' throws a 'TestProcessException'.
MY OBJECTIVE IS: I want this 'TestProcessException' to be handled by the struts framework and automatically call my 'MyExceptionHandler' class to handle this exception. MY PROBLEM IS: How do i make the struts framework call the 'MyExceptionHandler' to handle the 'TestProcessException'? How do i code my Action class to make this happen? This is what i have in my struts-config.xml: <action-mappings> <action path="/createBook" name="bookForm" type="BookAction" input="/CreateBook.jsp" scope="request" validate="true"> <exception handler="com.foo.framework.strutscustomization.MyExceptionHandler" type="com.foo.framework.exception.TestProcessException"/> </action> </action-mappings> public class BookAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) { System.out.println("Start perform(" + form + ") . . ." ); //String title = req.getParameter("title"); Book book = new Book(); //BookForm bookform = (BookForm) form; //book = bookform.getBook(); DynaValidatorForm dynaform = (DynaValidatorForm) form; String title = (String) dynaform.get("title"); book.setTitle(title); System.out.println("After creation of book: " + book.getTitle() ); ////////////////////Testing Exception Handling try { System.out.println("~~~~~~~~~~Calling scheduling delegate"); SchedulingDelegate sd = new SchedulingDelegate(); SchedulingDelegate.updateRotation(); } catch(TestProcessException tce){ System.out.println("tce occurred"); // throw new TestProcessException("ActionClass :",tce); } ////////////////////// req.setAttribute("BOOK", book); return mapping.findForward("bookCreated"); } } -- To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>