Package org.springmodules.xt.ajax.support

Examples of org.springmodules.xt.ajax.support.UnsupportedEventException


                logger.info(new StringBuilder("Invoking method: ").append(m));
                response = (AjaxResponse) m.invoke(this, new Object[]{event});
            }
            else {
                logger.error("You need to call the supports() method first!");
                throw new UnsupportedEventException("You need to call the supports() method first!");
            }
        }
        catch(IllegalAccessException ex) {
            logger.error(ex.getMessage(), ex);
            logger.error("Cannot handle the given event with id: " + id);
            throw new UnsupportedEventException("Cannot handle the given event with id: " + id, ex);
        }
        catch(InvocationTargetException ex) {
            logger.error(ex.getMessage(), ex);
            logger.error("Exception while handling the given event with id: " + id);
            throw new EventHandlingException("Exception while handling the given event with id: " + id, ex);
View Full Code Here


                            supported = true;
                            break;
                        }
                    }
                    if (!supported) {
                        throw new UnsupportedEventException("Cannot handling the given event with id: " + eventId);
                    } else {
                        if (ajaxResponse != null && !ajaxResponse.isEmpty()) {
                            logger.info("Sending Ajax response after Ajax action.");
                            AjaxResponseSender.sendResponse(response, ajaxResponse);
                        } else {
View Full Code Here

                            supported = true;
                            break;
                        }
                    }
                    if (!supported) {
                        throw new UnsupportedEventException("Cannot handling the given event with id: " + eventId);
                    } else {
                        if (ajaxResponse != null && ! ajaxResponse.isEmpty()) {
                            // Need to clear the ModelAndView because we are handling the response by ourselves:
                            modelAndView.clear();
                            AjaxResponseSender.sendResponse(response, ajaxResponse);
View Full Code Here

        MockHttpServletRequest httpRequest = new MockHttpServletRequest("GET", "/ajax/test.action");
        MockHttpServletResponse httpResponse = new MockHttpServletResponse();
        SimpleFormController controller = new SimpleFormController();
        httpRequest.setParameter("ajax-request", "ajax-action");
       
        ModelAndView mv = ajaxExceptionResolver.resolveException(httpRequest, httpResponse, controller, new UnsupportedEventException("exception"));
       
        assertTrue(mv.wasCleared());
    }
View Full Code Here

        MockHttpServletRequest httpRequest = new MockHttpServletRequest("GET", "/ajax/test.action");
        MockHttpServletResponse httpResponse = new MockHttpServletResponse();
        SimpleFormController controller = new SimpleFormController();
        httpRequest.setParameter("ajax-request", "ajax-submit");
       
        ModelAndView mv = ajaxExceptionHandler.resolveException(httpRequest, httpResponse, controller, new UnsupportedEventException("exception"));
       
        assertTrue(mv.wasCleared());
    }
View Full Code Here

       
        MockHttpServletRequest httpRequest = new MockHttpServletRequest("GET", "/test.action");
        MockHttpServletResponse httpResponse = new MockHttpServletResponse();
        SimpleFormController controller = new SimpleFormController();
       
        ModelAndView mv = ajaxExceptionHandler.resolveException(httpRequest, httpResponse, controller, new UnsupportedEventException("exception"));
       
        assertNull(mv);
    }
View Full Code Here

    public void testLookupExceptionResolver() {
        AjaxExceptionHandlerResolver ajaxExceptionHandler = (AjaxExceptionHandlerResolver) this.applicationContext.getBean("ajaxExceptionResolver");
       
        AjaxExceptionHandler resolver = null;
       
        resolver = ajaxExceptionHandler.lookupExceptionHandler(new UnsupportedEventException("exception"));
        assertNotNull(resolver);
        assertTrue(resolver instanceof RedirectExceptionHandler);
        assertEquals("/test/redirect1.html", ((RedirectExceptionHandler) resolver).getRedirectUrl());
       
        resolver = ajaxExceptionHandler.lookupExceptionHandler(new EventHandlingException("exception"));
View Full Code Here

TOP

Related Classes of org.springmodules.xt.ajax.support.UnsupportedEventException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.