Package org.apache.wicket.protocol.http.servlet

Examples of org.apache.wicket.protocol.http.servlet.AbortWithWebErrorCodeException


    // If we don't have an even number of pairs
    if (pairs.length % 2 != 0)
    {
      log.warn("URL fragment has unmatched key/value pairs, responding with 404. Fragment: " +
        urlFragment);
      throw new AbortWithWebErrorCodeException(404);
    }

    // Loop through pairs

    ValueMap parameters = new ValueMap();
View Full Code Here


  public AbortExceptionPage(PageParameters parameters)
  {
    final boolean triggerError = parameters.getBoolean("trigger");

    if (!triggerError)
      throw new AbortWithWebErrorCodeException(1234, "this error will be rendered");

    IModel<List<Object>> model = new LoadableDetachableModel<List<Object>>()
    {
      private static final long serialVersionUID = -1285116295157071919L;

      @Override
      protected List<Object> load()
      {
        if (triggerError)
          throw new AbortWithWebErrorCodeException(1234,
            "this error will NOT be rendered");
        else
          return Collections.emptyList();
      }
    };
View Full Code Here

      String msg = "Unable to find package resource [path = " + absolutePath + ", style = "
          + style + ", locale = " + locale + "]";
      log.warn(msg);
      if (RequestCycle.get() instanceof WebRequestCycle)
      {
        throw new AbortWithWebErrorCodeException(HttpServletResponse.SC_NOT_FOUND, msg);
      }
      else
      {
        throw new AbortException();
      }
View Full Code Here

        String msg = "Direct access not allowed for mounted targets";
        // the target was mounted, but we got here via another path
        // : deny the request
        log.error(msg + " [request=" + requestCycle.getRequest() + ",target=" + target
            + ",session=" + Session.get() + "]");
        throw new AbortWithWebErrorCodeException(HttpServletResponse.SC_FORBIDDEN, msg);
      }
    }

    if (target == null)
    {
View Full Code Here

    // If we don't have an even number of pairs
    if (pairs.length % 2 != 0)
    {
      log.warn("URL fragment has unmatched key/value pairs, responding with 404. Fragment: " +
        urlFragment);
      throw new AbortWithWebErrorCodeException(404);
    }

    // Loop through pairs

    ValueMap parameters = new ValueMap();
View Full Code Here

          String msg = "Direct access not allowed for mounted targets";
          // the target was mounted, but we got here via another path
          // : deny the request
          log.error(msg + " [request=" + requestCycle.getRequest() + ",target=" + target +
            ",session=" + Session.get() + "]");
          throw new AbortWithWebErrorCodeException(HttpServletResponse.SC_FORBIDDEN, msg);
        }
      }
    }

    // (WICKET-1356) in case no target was found, return null here. RequestCycle will deal with
View Full Code Here

  public AbortExceptionPage(PageParameters parameters)
  {
    final boolean triggerError = parameters.getBoolean("trigger");

    if (!triggerError)
      throw new AbortWithWebErrorCodeException(1234, "this error will be rendered");

    IModel<List<Object>> model = new LoadableDetachableModel<List<Object>>()
    {
      private static final long serialVersionUID = -1285116295157071919L;

      @Override
      protected List<Object> load()
      {
        if (triggerError)
          throw new AbortWithWebErrorCodeException(1234,
            "this error will NOT be rendered");
        else
          return Collections.emptyList();
      }
    };
View Full Code Here

      if (bufferedWebResponse.isAjax() &&
        request.getParameter(SourcesPage.PAGE_CLASS) != null)
      {
        // If there is a better way to figure out if SourcesPage was the request, we should
        // do that.
        throw new AbortWithWebErrorCodeException(404);
      }
    }
  }
View Full Code Here

        {
          if (log.isErrorEnabled())
          {
            log.error("key: " + PAGE_CLASS + " is null.");
          }
          throw new AbortWithWebErrorCodeException(404,
            "Could not find sources for the page you requested");
        }
        if (!pageParam.startsWith("org.apache.wicket.examples"))
        {
          if (log.isErrorEnabled())
          {
            log.error("user is trying to access class: " + pageParam +
              " which is not in the scope of org.apache.wicket.examples");
          }
          throw new UnauthorizedInstantiationException(getClass());
        }
        page = (Class<? extends Page>)Class.forName(getPageParam());
      }
      catch (ClassNotFoundException e)
      {
        throw new AbortWithWebErrorCodeException(404,
          "Could not find sources for the page you requested");
      }
    }
    return page;
  }
View Full Code Here

  {
    final boolean triggerError = parameters.getBoolean("trigger");

    if (!triggerError)
    {
      throw new AbortWithWebErrorCodeException(1234, "this error will be rendered");
    }

    IModel<List<Object>> model = new LoadableDetachableModel<List<Object>>()
    {
      private static final long serialVersionUID = -1285116295157071919L;

      @Override
      protected List<Object> load()
      {
        if (triggerError)
        {
          throw new AbortWithWebErrorCodeException(1234,
            "this error will NOT be rendered");
        }
        else
        {
          return Collections.emptyList();
View Full Code Here

TOP

Related Classes of org.apache.wicket.protocol.http.servlet.AbortWithWebErrorCodeException

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.