Package org.kohsuke.stapler.HttpResponses

Examples of org.kohsuke.stapler.HttpResponses.HttpResponseException


     *
     * @param destination
     *      The page that the user will be taken to upon a successful submission (in case this is not via the "apply" button.)
     */
    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);
View Full Code Here


     * <p>
     * When the response HTML includes a JavaScript function in a pre-determined name, that function gets executed.
     * This method generates such a response from JavaScript text.
     */
    public static HttpResponseException applyResponse(final String script) {
        return new HttpResponseException() {
            public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
                rsp.setContentType("text/html;charset=UTF-8");
                rsp.getWriter().println("<html><body><script>" +
                        "window.applyCompletionHandler = function (w) {" +
                        "  with(w) {" +
View Full Code Here

TOP

Related Classes of org.kohsuke.stapler.HttpResponses.HttpResponseException

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.