Package org.apache.tapestry5.util

Examples of org.apache.tapestry5.util.TextStreamResponse


    }

    Object onActionFromStreamReturnValue()
    {
        String text = "<html><body>Success!</body></html>";
        return new TextStreamResponse("text/html", text);
    }
View Full Code Here


    }

    Object onEdit() {
        value = request.getParameter(PARAM_NAME);

        return new TextStreamResponse("text/plain", value);
    }
View Full Code Here

            items.put(item);
        }

        myResults.put("items", items);

        return new TextStreamResponse("application/json", myResults.toString());
    }
View Full Code Here

        MarkupWriter writer = factory.newPartialMarkupWriter(contentType);

        generateResponseMarkup(writer, matchesHolder.get());

        return new TextStreamResponse(contentType.toString(), writer.toString());
    }
View Full Code Here

        train_isRequired(validator, false);
        train_getValueType(validator, Object.class);
        validator.validate(field, 5, formatter, inputValue);

        ValidatorMacro macro = mockValidatorMacro();
        train_alwaysNull(macro);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, fs, map, macro);
View Full Code Here

        train_isRequired(validator, false);
        train_getValueType(validator, Object.class);
        validator.validate(field, 5, formatter, inputValue);

        ValidatorMacro macro = mockValidatorMacro();
        train_alwaysNull(macro);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, fs, map, macro);
View Full Code Here

        train_getContainerMessages(resources, containerMessages);

        train_contains(containerMessages, "myform-fred-minlength", false);
        train_contains(containerMessages, "fred-minlength", false);

        ValidatorMacro macro = mockValidatorMacro();
        train_alwaysNull(macro);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, fs, map, macro);
View Full Code Here

        train_isRequired(validator, false);
        train_getValueType(validator, Object.class);
        validator.validate(field, null, formatter, inputValue);

        ValidatorMacro macro = mockValidatorMacro();
        train_alwaysNull(macro);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, fs, map, macro);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void simple_macro_expansion() throws Exception
    {

        ValidatorMacro macro = mockValidatorMacro();
        expect(macro.valueForMacro("combo")).andReturn("required,minlength=5");
        expect(macro.valueForMacro("required")).andReturn(null);
        expect(macro.valueForMacro("minlength")).andReturn(null);

        replay();

        FieldValidatorSourceImpl source = new FieldValidatorSourceImpl(null, null, null, null, macro);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void macros_can_not_have_constraints() throws Exception
    {

        ValidatorMacro macro = mockValidatorMacro();
        expect(macro.valueForMacro("combo")).andReturn("required,minlength=5");

        replay();

        FieldValidatorSourceImpl source = new FieldValidatorSourceImpl(null, null, null, null, macro);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.util.TextStreamResponse

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.