Package org.rendersnake.servlet

Examples of org.rendersnake.servlet.FormHandler


        String uri = "";
        String info = req.getPathInfo();
        if (null != info && info.length() > 0) {
            uri = info.substring(1);           
        }
        FormHandler handler = this.handlerMap.get(uri);
        if (handler == null) {
            resp.sendError(404);
        } else {
            FormResponseAction action = handler.handle(req, resp);
            if (action.redirectToUrl != null) {
                resp.sendRedirect(action.redirectToUrl);
                return;
            } else if (action.component != null){
                HtmlServletCanvas html = new HtmlServletCanvas(req, resp, resp.getWriter());
View Full Code Here


                    } else {
                        LOG.severe("Missing @Named annotation in component:"+klass);
                    }
                }
                if (FormHandler.class.isAssignableFrom(klass)) {
                    FormHandler h = (FormHandler)injector.getInstance(klass);
                    Named annotation = klass.getAnnotation(Named.class);
                    if (annotation != null) {
                        handlerMap.put(annotation.value(), h);
                        LOG.info("Binding component:"+klass+" to:" + annotation);
                    } else {
View Full Code Here

    }

    public void testFormHandlerFound() {
        MockHttpRequest request = new MockHttpRequest();
        request.pathInfo = "/org.rendersnake.test.SearchPage";
        FormHandler comp = resolver.formHandlerForRequest(request);
        assertTrue(comp.getClass() == SearchPage.class);
    }
View Full Code Here

    public void testFormHandlerNotFound() {
        MockHttpRequest request = new MockHttpRequest();
        request.pathInfo = "/org.rendersnake.test.MissingPage";
        try {
            FormHandler comp = resolver.formHandlerForRequest(request);
            fail("should not be here");
        } catch (Exception ex) {
            assertTrue(true);
        }
    }
View Full Code Here

TOP

Related Classes of org.rendersnake.servlet.FormHandler

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.