Examples of HttpError


Examples of net.kd8rho.util.data.HTTPError

                        if (s.equals("code:")) {
                            errorCode = splitString[i + 1];
                            break;
                        }
                    }
                    HTTPError theError=new HTTPError(Integer.parseInt(errorCode),e.getMessage());
                    last_error=theError;
                    if(theError.getErrorCode()==403||theError.getErrorCode()==404)
                    {
                        break;
                    }
                }
                io.writeLine("Failed with " + e.getClass().getName() + ". Retrying " + (retries - count) + " more times");
View Full Code Here

Examples of net.kd8rho.util.data.HTTPError

                        if (s.equals("code:")) {
                            errorCode = splitString[i + 1];
                            break;
                        }
                    }
                    HTTPError theError=new HTTPError(Integer.parseInt(errorCode),e.getMessage());
                    last_error=theError;
                    if(theError.getErrorCode()==403||theError.getErrorCode()==404)
                    {
                        break;
                    }
                }
                io.writeLine("Failed with " + e.getClass().getName() + ". Retrying " + (retries - count) + " more times");
View Full Code Here

Examples of org.apache.tapestry5.services.HttpError

  // 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

Examples of org.apache.tapestry5.services.HttpError

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

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

Examples of org.apache.tapestry5.services.HttpError

        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

Examples of org.apache.tapestry5.services.HttpError

 
  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

Examples of org.apache.tapestry5.services.HttpError

public class TestPageForHttpError
{

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

Examples of org.apache.tapestry5.services.HttpError

    }
   

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

Examples of org.apache.tapestry5.services.HttpError

                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

Examples of org.apache.tapestry5.services.HttpError

   * Tapestry redirects 404's home.  We can use an empty context
   * to determine that we have a 404 redirect and notify accordingly
   */
  Object onActivate(EventContext context) {
         if (context.getCount() == 0) return null;
        return new HttpError(404, "Resource not found.");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.