All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web.throttling.update.jsp Maven / Gradle / Ivy



<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
<%@ page import="org.wso2.carbon.CarbonConstants" %>
<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
<%@ page import="org.wso2.carbon.mediator.throttle.client.ThrottleClient" %>
<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>

<%
    //Obtaining the client-side ConfigurationContext instance.
    ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
            .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);

    //Server URL which is defined in the server.xml
    String serverBackendURL = CarbonUIUtil.getServerURL(config.getServletContext(),
            session);

    String service = request.getParameter("serviceName");
    String operation = request.getParameter("opName");
    String params = "";

    if (service != null) {
        if (operation == null) {
            params = "serviceName=" + service;
        } else {
            params = "serviceName=" + service + "&opName=" + operation;
        }
    }

    String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);

    try {
        ThrottleClient client = new ThrottleClient(cookie,
                serverBackendURL, configContext, request.getLocale());
        client.updateBackEnd(request);
    } catch (NumberFormatException e) {
%>

<%
        return;
    } catch (Exception e) {
        CarbonUIMessage.sendCarbonUIMessage(e.getMessage(), CarbonUIMessage.ERROR, request, e);
%>

<%
        return;
    }
    String backURL = (String) session.getAttribute("backURL");
    session.removeAttribute("backURL");
%>





© 2015 - 2025 Weber Informatics LLC | Privacy Policy