Generates the response for the form submission in such a way that it handles the "apply" button
correctly.

@param destination
The page that the user will be taken to upon a successful submission (in case this is not via the "apply" button.)
509998
public static HttpResponseException success(final String destination) {
        return new HttpResponseException() {
            public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
                if (isApply(req)) {
                    // if the submission is via 'apply', show a response in the notification bar
                    applyResponse("notificationBar.show('"+Messages.HttpResponses_Saved()+"',notificationBar.OK)")
                            .generateResponse(req,rsp,node);
                } else {
                    rsp.sendRedirect(destination);
                }
            }
        };
    }
481536
public final void checkPermission( Destination destination , String action ) throws JMSException
    {
    	if (securityContext == null)
            return; // Security is disabled
    	
    	DestinationRef destinationRef = DestinationTools.asRef(destination);
    	securityContext.checkPermission(destinationRef.getResourceName(), action);        
    }
716410
public void sendForm(HttpServletRequest req, HttpServletResponse res, String strReceiveMessage, Properties properties)
		throws ServletException, IOException
	{
		if (properties.getProperty(DESTINATION) == null)
		{		// Check to see if a param was set in get (ie., ?dest=xyz)
			String[] strParamDest = req.getParameterValues(DESTINATION);
			if ((strParamDest != null)
				&& (strParamDest.length > 0)
					&& (strParamDest[0] != null)
						&& (strParamDest[0].length() > 0))
							properties.setProperty(DESTINATION, strParamDest[0]);
		}
		super.sendForm(req, res, strReceiveMessage, properties);
	}
425321
public void addExportPoint(String uri, String destination) {

        CmsExportPoint point = new CmsExportPoint(uri, destination);
        m_exportPoints.add(point);
        if (CmsLog.INIT.isInfoEnabled() && (point.getDestinationPath() != null)) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_ADD_EXPORT_POINT_2,
                    point.getUri(),
                    point.getDestinationPath()));
        }
    }
1050648
public AsyncMessage createMessageForDestination(String destination) {
        AsyncMessage message = this.defaultMessageCreator.createMessage();
        message.setDestination(destination);
        return message;
    }
152212
def submit_response(self, question_id, answer_form=None):
        
        if answer_form is None:
            response = {'missingResponse': NULL_RESPONSE,
                        'itemId': str(question_id)}
        else:
            response = dict(answer_form._my_map)
            response['submissionTime'] = DateTime.utcnow()
            try:
                response['isCorrect'] = self._get_item(question_id).is_response_correct(
                    Response(osid_object_map=response, runtime=self._runtime, proxy=self._proxy))
            except (errors.IllegalState, errors.NotFound):
                response['isCorrect'] = None
        response['submissionTime'] = DateTime.utcnow()

        question_map = self._get_question_map(question_id)  # will raise NotFound()
        if ('missingResponse' in question_map['responses'][0] and
                question_map['responses'][0]['missingResponse'] == UNANSWERED):
            question_map['responses'] = []  # clear unanswered response
        question_map['responses'].insert(0, response)
        self._save()
1241112
private void submitResults(Object task, Object results) throws JobExecutionException {
    synchronized (monitor) {
      this.job.submitTaskResults(task, results, monitor);
    }
  }
352991
public HttpResponse doAction(HttpRequest request, String form, HttpMethod method)
        throws ClientException, ServerException {
        request.validate();
        
        // try refresh credentials if CredentialProvider set
        this.config.refreshCredentials();
        
        try {
            int retryTimes = 0;
            HttpResponse response = null;

            boolean httpInvoke = false;
            if (request instanceof HttpInvokeFunctionRequest) {
                httpInvoke = true;
            }

            do {
                if (!httpInvoke
                    || !ANONYMOUS.equals(((HttpInvokeFunctionRequest) request).getAuthType())) {
                    signRequest(request, form, method, httpInvoke);
                }

                PrepareUrl prepareUrl = prepareUrl(request.getPath(), request.getQueryParams());

                response = HttpResponse.getResponse(prepareUrl.getUrl(), request, method,
                    config.getConnectTimeoutMillis(), config.getReadTimeoutMillis());

                retryTimes++;

                if (httpInvoke) {
                    return response;
                }

            } while (500 <= response.getStatus() && AUTO_RETRY && retryTimes < MAX_RETRIES);

            if (response.getStatus() >= 500) {
                String requestId = response.getHeader(HeaderKeys.REQUEST_ID);
                String stringContent =
                    response.getContent() == null ? "" : new String(response.getContent());
                ServerException se;
                try {
                    se = new Gson().fromJson(stringContent, ServerException.class);
                } catch (JsonParseException e) {
                    se = new ServerException("InternalServiceError",
                        "Failed to parse response content", requestId);
                }
                se.setStatusCode(response.getStatus());
                se.setRequestId(requestId);
                throw se;
            } else if (response.getStatus() >= 300) {
                ClientException ce;
                if (response.getContent() == null) {
                    ce = new ClientException("SDK.ServerUnreachable",
                        "Failed to get response content from server");
                } else {
                    try {
                        ce = new Gson()
                            .fromJson(new String(response.getContent()), ClientException.class);
                    } catch (JsonParseException e) {
                        ce = new ClientException("SDK.ResponseNotParsable",
                            "Failed to parse response content", e);
                    }
                }
                if (ce == null) {
                    ce = new ClientException("SDK.UnknownError", "Unknown client error");
                }
                ce.setStatusCode(response.getStatus());
                ce.setRequestId(response.getHeader(HeaderKeys.REQUEST_ID));
                throw ce;
            }
            return response;
        } catch (InvalidKeyException exp) {
            throw new ClientException("SDK.InvalidAccessSecret",
                "Speicified access secret is not valid.");
        } catch (SocketTimeoutException exp) {
            throw new ClientException("SDK.ServerUnreachable",
                "SocketTimeoutException has occurred on a socket read or accept.");
        } catch (IOException exp) {
            throw new ClientException("SDK.ServerUnreachable",
                "Server unreachable: " + exp.toString());
        } catch (NoSuchAlgorithmException exp) {
            throw new ClientException("SDK.InvalidMD5Algorithm",
                "MD5 hash is not supported by client side.");
        } catch (URISyntaxException e) {
            throw new ClientException("SDK.InvalidURL", "url is not valid: " + e.getMessage());
        }
    }
460434
def submit(opts={})
      response = Hubspot::FormsConnection.submit(SUBMIT_DATA_PATH, params: { form_guid: @guid }, body: opts)
      [204, 302, 200].include?(response.code)
    end
403698
private javax.jms.Message receive(Destination destination, String selector) {
        javax.jms.Message receivedJmsMessage;

        if (log.isDebugEnabled()) {
            log.debug("Receiving JMS message on destination: '" + endpointConfiguration.getDestinationName(destination) + (StringUtils.hasText(selector) ? "(" + selector + ")" : "") + "'");
        }

        if (StringUtils.hasText(selector)) {
            receivedJmsMessage = endpointConfiguration.getJmsTemplate().receiveSelected(destination, selector);
        } else {
            receivedJmsMessage = endpointConfiguration.getJmsTemplate().receive(destination);
        }

        if (receivedJmsMessage == null) {
            throw new ActionTimeoutException("Action timed out while receiving JMS message on '" + endpointConfiguration.getDestinationName(destination) + (StringUtils.hasText(selector) ? "(" + selector + ")" : "") + "'");
        }

        log.info("Received JMS message on destination: '" + endpointConfiguration.getDestinationName(destination) + (StringUtils.hasText(selector) ? "(" + selector + ")" : "") + "'");

        return receivedJmsMessage;
    }
1151419
private void cmdExportResultActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonSaveResultsActionPerformed
		JFileChooser fileChooser = new JFileChooser(System.getProperty("user.dir"));
		fileChooser.setDialogTitle("Export to...");
		int response = fileChooser.showSaveDialog(this);
		if (response == JFileChooser.APPROVE_OPTION) {
			File targetFile = fileChooser.getSelectedFile();
			final String fileLocation = targetFile.getPath();
			if (canWrite(targetFile)) {
				Thread thread = new Thread() {
					public void run() {						
						getOBDASaveQueryToFileAction().run(fileLocation);
					}
				};
				thread.start();
			}
		}
	}
640047
static void sendResponse(final ManagementRequestContext<RegistrationContext> context, final byte responseType, final ModelNode response) throws IOException {
        final ManagementResponseHeader header = ManagementResponseHeader.create(context.getRequestHeader());
        final FlushableDataOutput output = context.writeMessage(header);
        try {
            sendResponse(output, responseType, response);
        } finally {
            StreamUtils.safeClose(output);
        }
    }
398116
void submit() {

        int action = -1;

        if (isModeAll()) {
            action = CmsFlexCache.CLEAR_ONLINE_ALL;
        } else {
            action = CmsFlexCache.CLEAR_ONLINE_ENTRIES;
        }

        OpenCms.fireCmsEvent(
            new CmsEvent(
                I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR,
                Collections.<String, Object> singletonMap(CmsFlexCache.CACHE_ACTION, new Integer(action))));
    }
899861
async def send_to(self, destination: discord.abc.Messageable):
        

        self.message = await destination.send(**self.send_kwargs)

        # add the close reaction
        await self.message.add_reaction(self.emojis.close)

        # if there is more than one page, and the reactions haven't been sent yet, send navigation emotes
        if not self.sent_page_reactions and self.page_count > 1:
            await self.send_all_reactions()

        if self.task:
            self.task.cancel()

        self.task = self.bot.loop.create_task(self.wait_loop())
309587
public void afterResponse(Event event) {
		ChaincodeMessage message = messageHelper(event);
		try {
			sendChannel(message);
			logger.debug(String.format("[%s]Received %s, communicated (state:%s)",
					shortID(message), message.getType(), fsm.current()));
		} catch (Exception e) {
			logger.error(String.format("[%s]error sending %s (state:%s): %s", shortID(message),
					message.getType(), fsm.current(), e));
		}
	}
566741
void submit() {

        // switch to root site
        m_clonedCms.getRequestContext().setSiteRoot("");

        CmsSite site = getSiteFromForm();

        if (m_site == null) {

            //Show report field and hide form fields
            m_report.setVisible(true);
            m_tab.setVisible(false);
            m_ok.setEnabled(false);
            m_ok.setVisible(true);
            //Change cancel caption to close (will not interrupt site creation anymore)
            m_cancel.setVisible(false);
            setOkButtonEnabled();
            m_cancel.setCaption(
                CmsVaadinUtils.getMessageText(org.opencms.workplace.Messages.GUI_DIALOG_BUTTON_CLOSE_0));

            Map<String, String> bundle = getBundleMap();

            boolean createOU = m_fieldCreateOU.isEnabled() & m_fieldCreateOU.getValue().booleanValue();
            CmsCreateSiteThread createThread = new CmsCreateSiteThread(
                m_clonedCms,
                m_manager,
                site,
                m_site,
                m_fieldLoadSiteTemplate.getValue(),
                getFieldTemplate(),
                createOU,
                (String)m_fieldSelectParentOU.getValue(),
                (String)m_fieldSelectOU.getValue(),
                m_os,
                bundle,
                new Runnable() {

                    public void run() {

                }

                });

            CmsReportWidget report = new CmsReportWidget(createThread);

            report.setWidth("100%");
            report.setHeight("350px");

            m_threadReport.addComponent(report);
            createThread.start();
        } else {
            if (!site.getSiteRoot().equals(m_site.getSiteRoot())) {
                m_manager.deleteElements(Collections.singletonList(m_site.getSiteRoot()));
            }
            m_manager.writeElement(site);
            m_manager.closeDialogWindow(true);
        }

    }
1254940
protected Button newSubmitButton(final String id, final Form<?> form)
	{
		final Button button = new AjaxFallbackButton(id, form)
		{
			/**
			 * The serialVersionUID
			 */
			private static final long serialVersionUID = 1L;

			/**
			 * {@inheritDoc}
			 */
			@Override
			protected void onError(final AjaxRequestTarget target, final Form<?> form)
			{
				BeanEditorPanel.this.onSubmit(target, form);
			}

			/**
			 * {@inheritDoc}
			 */
			@Override
			protected void onSubmit(final AjaxRequestTarget target, final Form<?> form)
			{
				BeanEditorPanel.this.onSubmit(target, form);
			}
		};
		return button;
	}