Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.ExceptionReporter


        "class", "t-autocomplete-menu");
        writer.end();

        Link link = resources.createEventLink(EVENT_NAME);

        JSONObject config = new JSONObject();
        config.put("paramName", PARAM_NAME);
        config.put("indicator", loaderId);

        if (resources.isBound("minChars"))
            config.put("minChars", minChars);

        if (resources.isBound("frequency"))
            config.put("frequency", frequency);

        if (resources.isBound("tokens"))
        {
            for (int i = 0; i < tokens.length(); i++)
            {
                config.accumulate("tokens", tokens.substring(i, i + 1));
            }
        }

        // Let subclasses do more.
        configure(config);
View Full Code Here


     * not formatted correct.
     */
    JSONObject onParse(@RequestParameter(INPUT_PARAMETER)
    String input)
    {
        JSONObject response = new JSONObject();

        try
        {
            Date date = format.parse(input);

            response.put(RESULT, date.getTime());
        }
        catch (ParseException ex)
        {
            response.put(ERROR, ex.getMessage());
        }

        return response;
    }
View Full Code Here

     * the result.
     */
    JSONObject onFormat(@RequestParameter(INPUT_PARAMETER)
    String input)
    {
        JSONObject response = new JSONObject();

        try
        {
            long millis = Long.parseLong(input);

            Date date = new Date(millis);

            response.put(RESULT, format.format(date));
        }
        catch (NumberFormatException ex)
        {
            response.put(ERROR, ex.getMessage());
        }

        return response;
    }
View Full Code Here

        response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        response.setHeader("X-Tapestry-ErrorMessage", InternalUtils.toMessage(exception));

        Page page = pageCache.get(pageName);

        ExceptionReporter rootComponent = (ExceptionReporter) page.getRootComponent();

        // Let the page set up for the new exception.

        rootComponent.reportException(exception);

        renderer.renderPageResponse(page);
    }
View Full Code Here

    {
        logger.error(ServicesMessages.requestException(exception), exception);

        Page page = pageCache.get(pageName);

        ExceptionReporter rootComponent = (ExceptionReporter) page.getRootComponent();

        // Let the page set up for the new exception.

        rootComponent.reportException(exception);

        renderer.renderPageResponse(page);
    }
View Full Code Here

            {
                return null;
            }
        });

        ExceptionReporter noopExceptionReporter = new ExceptionReporter()
        {
            @Override
            public void reportException(Throwable exception)
            {
View Full Code Here

                        response.sendError(HttpServletResponse.SC_FORBIDDEN);
                        return;
                    }
                    throwable = throwable.getCause();
                }
                ExceptionReporter errors = (ExceptionReporter) componentSource.getPage(vn.pyco.tinycms.web.pages.Exception.class);
                errors.reportException(exception);
                renderer.renderPageMarkupResponse("Exception");
            }
        };
    }
View Full Code Here

        response.setHeader("X-Tapestry-ErrorMessage", encoded);

        Page page = pageCache.get(pageName);

        ExceptionReporter rootComponent = (ExceptionReporter) page.getRootComponent();

        // Let the page set up for the new exception.

        rootComponent.reportException(exception);

        renderer.renderPageResponse(page);
    }
View Full Code Here

            {
                return null;
            }
        });

        ExceptionReporter noopExceptionReporter = new ExceptionReporter()
        {
            @Override
            public void reportException(Throwable exception)
            {
View Full Code Here

    {
        logger.error(ServicesMessages.requestException(exception), exception);

        Page page = pageCache.get("ExceptionReport");

        ExceptionReporter rootComponent = (ExceptionReporter) page.getRootComponent();

        // Let the page set up for the new exception.

        rootComponent.reportException(exception);

        renderer.renderPageResponse(page);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.services.ExceptionReporter

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.