Examples of RequestCycle


Examples of org.apache.tapestry.engine.RequestCycle

       
        decodeParameters(request.getActivationPath(), request.getPathInfo(), parameters);
       
        String serviceName = findService(parameters);
       
        IRequestCycle cycle = new RequestCycle(engine, parameters, serviceName, _environment);
       
        _requestGlobals.store(cycle);
       
        try {
            cycle.setResponseBuilder(_responseDelegateFactory.getResponseBuilder(cycle));
        } catch (IOException e) {
            throw new ApplicationRuntimeException("Error creating response builder.", e);
        }
       
        return cycle;
View Full Code Here

Examples of org.apache.wicket.RequestCycle

   * @param url
   *            The url which describes the component path and the interface to be called.
   */
  private void dispatchEvent(final Page page, final String url)
  {
    RequestCycle rc = RequestCycle.get();
    IRequestCycleProcessor processor = rc.getProcessor();
    final RequestParameters requestParameters = processor.getRequestCodingStrategy().decode(
      new FormDispatchRequest(rc.getRequest(), url));
    IRequestTarget rt = processor.resolve(rc, requestParameters);
    if (rt instanceof IListenerInterfaceRequestTarget)
    {
      IListenerInterfaceRequestTarget interfaceTarget = ((IListenerInterfaceRequestTarget)rt);
      interfaceTarget.getRequestListenerInterface().invoke(page, interfaceTarget.getTarget());
View Full Code Here

Examples of org.apache.wicket.ng.request.cycle.RequestCycle

  public final void onResourceRequested()
  {
    try
    {
      // Get request cycle
      final RequestCycle cycle = RequestCycle.get();

      // Fetch resource from subclass if necessary
      IResourceStream resourceStream = init();

      // Get servlet response to use when responding with resource
      final WebResponse response = (WebResponse)cycle.getResponse();

      // FIXME WICKET-385 Move HTTP caching features out of org.apache.wicket.Resource
      if (isCacheable())
      {
        response.setLastModifiedTime(resourceStream.lastModifiedTime().getMilliseconds());
      }
      else
      {
        response.setLastModifiedTime(-1);
      }
      configureResponse(response);

      cycle.scheduleRequestHandlerAfterCurrent(new ResourceStreamRequestHandler(
        resourceStream));
    }
    finally
    {
      // Really really really make sure parameters are cleared
View Full Code Here

Examples of org.apache.wicket.request.cycle.RequestCycle

    Session session = ThreadContext.getSession();

    if (session == null)
    {
      // no session is available via ThreadContext, so lookup in session store
      RequestCycle requestCycle = RequestCycle.get();
      if (requestCycle != null)
      {
        session = Application.get().getSessionStore().lookup(requestCycle.getRequest());
        if (session != null)
        {
          ThreadContext.setSession(session);
        }
      }
View Full Code Here

Examples of org.apache.wicket.request.cycle.RequestCycle

   */
  public final String getId()
  {
    if (id == null)
    {
      RequestCycle requestCycle = RequestCycle.get();
      if (requestCycle != null)
      {
        id = getSessionStore().getSessionId(requestCycle.getRequest(), false);
      }
      // we have one?
      if (id != null)
      {
        dirty();
View Full Code Here

Examples of org.apache.wicket.request.cycle.RequestCycle

   */
  public final Serializable getAttribute(final String name)
  {
    if (!isTemporary())
    {
      RequestCycle cycle = RequestCycle.get();
      if (cycle != null)
      {
        return getSessionStore().getAttribute(cycle.getRequest(), name);
      }
    }
    else
    {
      if (temporarySessionAttributes != null)
View Full Code Here

Examples of org.apache.wicket.request.cycle.RequestCycle

   */
  public final List<String> getAttributeNames()
  {
    if (!isTemporary())
    {
      RequestCycle cycle = RequestCycle.get();
      if (cycle != null)
      {
        return Collections.unmodifiableList(getSessionStore().getAttributeNames(
          cycle.getRequest()));
      }
    }
    else
    {
      if (temporarySessionAttributes != null)
View Full Code Here

Examples of org.apache.wicket.request.cycle.RequestCycle

   */
  public final void removeAttribute(String name)
  {
    if (!isTemporary())
    {
      RequestCycle cycle = RequestCycle.get();
      if (cycle != null)
      {
        getSessionStore().removeAttribute(cycle.getRequest(), name);
      }
    }
    else
    {
      if (temporarySessionAttributes != null)
View Full Code Here

Examples of org.apache.wicket.request.cycle.RequestCycle

   */
  public final void setAttribute(String name, Serializable value)
  {
    if (!isTemporary())
    {
      RequestCycle cycle = RequestCycle.get();
      if (cycle == null)
      {
        throw new IllegalStateException(
          "Cannot set the attribute: no RequestCycle available.  If you get this error when using WicketTester.startPage(Page), make sure to call WicketTester.createRequestCycle() beforehand.");
      }

      ISessionStore store = getSessionStore();
      Request request = cycle.getRequest();

      // extra check on session binding event
      if (value == this)
      {
        Object current = store.getAttribute(request, name);
View Full Code Here

Examples of org.apache.wicket.request.cycle.RequestCycle

  public final void onRequest()
  {
    WebApplication app = (WebApplication)getComponent().getApplication();
    AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage());

    RequestCycle requestCycle = RequestCycle.get();
    requestCycle.scheduleRequestHandlerAfterCurrent(target);

    respond(target);
  }
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.