Examples of CarbonUIMessage


Examples of org.wso2.carbon.ui.CarbonUIMessage

                                             HttpServletResponse res, String warnPage)
            throws IOException {

        //Page tobe redirected in the case of warning
        String warnRedirect = warnPage == null ? "index.jsp" : warnPage;
        CarbonUIMessage carbonMessage;
        String key;

        ResourceBundle resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE, req.getLocale());
        if (e.getFaultMessage() == null) {
            CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, req, e);
            res.sendRedirect("../admin/error.jsp");
            return;
        }

        ModuleMgtException moduleMgtException = ModuleManagementUtils.getModuleMgtException(e);

        if (moduleMgtException == null) {
            CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, req, e);
            res.sendRedirect("../admin/error.jsp");
            return;
        }

        if (moduleMgtException.getLevel() == ModuleManagementConstants.WARNING) {
            key = moduleMgtException.getKey();
            carbonMessage = new CarbonUIMessage(resourceBundle.getString(key), CarbonUIMessage.WARNING);
            req.getSession().setAttribute(CarbonUIMessage.ID, carbonMessage);
            res.sendRedirect(warnRedirect);
            return;
        } else if (moduleMgtException.getLevel() == ModuleManagementConstants.ERROR) {
            key = moduleMgtException.getKey();
            carbonMessage = new CarbonUIMessage(resourceBundle.getString(key), CarbonUIMessage.ERROR);
            req.getSession().setAttribute(CarbonUIMessage.ID, carbonMessage);
            res.sendRedirect("../admin/error.jsp");
            return;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.