Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.HttpError


        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();

        Map<String, Validator> map = singletonMap("required", validator);

        train_getFormValidationId(fs, "myform");
View Full Code Here


        MessageFormatter minLengthFormatter = mockMessageFormatter();
        Object inputValue = "input value";
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Integer fifteen = 15;
        FormSupport fs = mockFormSupport();

        Map<String, Validator> map = newMap();

        map.put("required", required);
        map.put("minLength", minLength);
View Full Code Here

        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Integer five = 5;
        FormSupport fs = mockFormSupport();

        Map<String, Validator> map = singletonMap("minLength", validator);

        train_getConstraintType(validator, Integer.class);
View Full Code Here

  // Handle call with an unwanted context
  Object onActivate(EventContext eventContext)
  {
    return eventContext.getCount() > 0 ?
        new HttpError(404, "Resource not found") :
        null;
  }
View Full Code Here

    Object onImage() throws IOException
    {
        if (captchaText == null)
        {
            return new HttpError(HttpServletResponse.SC_NOT_FOUND, "Session expired.");
        }

        return new StreamResponse()
        {
            @Override
View Full Code Here

        try {
            user = userManager.saveUser(user);
        } catch (AccessDeniedException ade) {
            // thrown by UserSecurityAdvice configured in aop:advisor
            logger.warn(ade.getMessage());
            return new HttpError(HttpServletResponse.SC_FORBIDDEN, "Resource not available");
        } catch (UserExistsException e) {
            // TODO #1: FIXME: only username should be highlighted.. move to onValidate()?

            alertManager.error(
                    messages.format("errors.existing.user", user.getUsername(), user.getEmail())
View Full Code Here

 
  private Channel channel;
 
  Object onActivate(EventContext context) {
    channel = channelProvider.getChannel(context);
    return channel != null ? null : new HttpError(404, messages.get(RssConstants.HTTP_ERROR_404_MESSAGE_KEY));
  }
View Full Code Here

public class TestPageForHttpError
{

    Object onActivate()
    {
        return new HttpError(HttpServletResponse.SC_MOVED_TEMPORARILY, "Oups! Resource moved. Try again later.");
    }
View Full Code Here

    }
   

    Object onActionFromHttpError()
    {
        return new HttpError(HttpServletResponse.SC_GONE, "Oups! Resource disappeared!");
    }
View Full Code Here

                pageResources.getPage().getClass(), activationContext);

        String message = String.format("Activation context %s unrecognized for page %s",
                activationContext, pageResources.getPage().getClass());

        resultProcessor.processResultValue(new HttpError(HttpServletResponse.SC_NOT_FOUND, message));
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.services.HttpError

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.