Package net.sourceforge.stripes.action

Examples of net.sourceforge.stripes.action.StreamingResolution


    public Resolution updateMemu() {
       
        log.info("item with id='" + itemId + "' moved to item with id='" + newParentId +
                "' on position " + newPosition);

        return new StreamingResolution("text/plain", "Menu structure updated");
    }
View Full Code Here


    /** A very simple add event that returns the result in the response stream. */
    @HandlesEvent("addAndStream")
    public Resolution addAndStream() {
        this.result = lhs + rhs;
        return new StreamingResolution("text/plain", new StringReader(String.valueOf(this.result)));
    }
View Full Code Here

        Attachment attachment = bug.getAttachments().get(this.attachmentIndex);

        // Uses a StreamingResolution to send the file contents back to the user.
        // Note the use of the chained .setFilename() method, which causes the
        // browser to [prompt to] save the "file" instead of displaying it in browser
        return new StreamingResolution
                (attachment.getContentType(), new ByteArrayInputStream(attachment.getData()))
                    .setFilename(attachment.getName());
    }
View Full Code Here

                message.append(error.getMessage(getContext().getLocale()));
                message.append("</div>");
            }
        }

        return new StreamingResolution("text/html", new StringReader(message.toString()));
    }
View Full Code Here

    }

    /** Handles the 'add' event, adds the two numbers and returns the result. */
    @DefaultHandler public Resolution add() {
        String result = String.valueOf(numberOne + numberTwo);
        return new StreamingResolution("text", new StringReader(result));
    }
View Full Code Here

    }

    /** Handles the 'divide' event, divides number two by oneand returns the result. */
    public Resolution divide() {
        String result = String.valueOf(numberOne / numberTwo);
        return new StreamingResolution("text", new StringReader(result));
    }
View Full Code Here

                message.append(error.getMessage(getContext().getLocale()));
                message.append("</div>");
            }
        }

        return new StreamingResolution("text/html", new StringReader(message.toString()));
    }
View Full Code Here

    }

    /** Handles the 'add' event, adds the two numbers and returns the result. */
    @DefaultHandler public Resolution add() {
        String result = String.valueOf(numberOne + numberTwo);
        return new StreamingResolution("text", new StringReader(result));
    }
View Full Code Here

    }

    /** Handles the 'divide' event, divides number two by oneand returns the result. */
    public Resolution divide() {
        String result = String.valueOf(numberOne / numberTwo);
        return new StreamingResolution("text", new StringReader(result));
    }
View Full Code Here

        Attachment attachment = getBug().getAttachments().get(this.attachmentIndex);

        // Uses a StreamingResolution to send the file contents back to the user.
        // Note the use of the chained .setFilename() method, which causes the
        // browser to [prompt to] save the "file" instead of displaying it in browser
        return new StreamingResolution(attachment.getContentType(),
                new ByteArrayInputStream(attachment.getData())).setFilename(attachment.getName());
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.action.StreamingResolution

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.