/** * Initialize a new WebRequestCycle and all its dependent objects * * @param component */ public void processRequestCycle(final Component component) { setupRequestAndResponse(); final WebRequestCycle cycle = createRequestCycle(); cycle.request(component); if (component instanceof Page) { lastRenderedPage = (Page)component; } postProcessRequestCycle(cycle); }
/** * clears this mock application */ public void destroy() { filter.destroy(); File dir = (File)context.getAttribute("javax.servlet.context.tempdir"); deleteDir(dir); }
/** * Create and process the request cycle using the current request and response information. */ public void processRequestCycle() { processRequestCycle(createRequestCycle()); }
/** * Reset the request and the response back to a starting state and recreate the necessary wicket * request, response and session objects. The request and response objects can be accessed and * Initialized at this point. * * @return the constructed {@link WebRequestCycle} */ public WebRequestCycle setupRequestAndResponse() { return setupRequestAndResponse(isCreateAjaxRequest()); }
lastRenderedPage = generateLastRenderedPage(cycle); wicketRequest = application.newWebRequest(newHttpRequest); cycle = createRequestCycle(); cycle.request(); lastRenderedPage = generateLastRenderedPage(cycle); Session.set(getWicketSession()); if (getLastRenderedPage() instanceof ExceptionErrorPage) throw (RuntimeException)((ExceptionErrorPage)getLastRenderedPage()).getThrowable();
context = newServletContext(path); servletSession.setTemporary(initializeHttpSessionAsTemporary()); servletRequest = new MockHttpServletRequest(this.application, servletSession, context); servletResponse = new MockHttpServletResponse(servletRequest); createRequestCycle();
/** * Create and process the request cycle using the current request and response information. * * @param cycle */ public void processRequestCycle(WebRequestCycle cycle) { try { cycle.request(); if (cycle.wasHandled() == false) { cycle.setRequestTarget(new WebErrorCodeResponseTarget( HttpServletResponse.SC_NOT_FOUND)); } createRequestCycle(); parametersForNextRequest.clear(); servletRequest.getParameterMap().clear(); } finally { cycle.getResponse().close(); } postProcessRequestCycle(cycle); }
/** * Reset the request and the response back to a starting state and recreate the necessary wicket * request, response and session objects. The request and response objects can be accessed and * Initialized at this point. * * @param isAjax * indicates whether the request should be initialized as an ajax request (ajax * header "Wicket-Ajax" is set) */ public WebRequestCycle setupRequestAndResponse(boolean isAjax) { servletRequest.initialize(); servletResponse.initialize(); servletRequest.setParameters(parametersForNextRequest); if (isAjax) { servletRequest.addHeader("Wicket-Ajax", "Yes"); } parametersForNextRequest.clear(); wicketRequest = application.newWebRequest(servletRequest); wicketResponse = application.newWebResponse(servletResponse); WebRequestCycle requestCycle = createRequestCycle(); if (!initializeHttpSessionAsTemporary()) application.getSessionStore().bind(wicketRequest, wicketSession); wicketResponse.setAjax(wicketRequest.isAjax()); return requestCycle; }
public <C extends Page> void processRequestCycle(final Class<C> pageClass, PageParameters params) final WebRequestCycle cycle = setupRequestAndResponse(); try path = path.substring(path.lastIndexOf('.') + 1); path = "/" + path + "/" + path + "/"; getServletRequest().setURL(path + url); path = path.substring(path.lastIndexOf('.') + 1); path = "/" + path + "/" + path + "/"; getServletRequest().setURL(path + url); postProcessRequestCycle(cycle);
/** * Initialize a new WebRequestCycle and all its dependent objects * * @param pageClass */ public void processRequestCycle(final Class pageClass) { processRequestCycle(pageClass, null); }
createRequestCycle(); IBookmarkablePageRequestTarget pageClassRequestTarget = (IBookmarkablePageRequestTarget)target; Class pageClass = pageClassRequestTarget.getPageClass();
/** * Reset the request and the response back to a starting state and recreate the necessary wicket * request, response and session objects. The request and response objects can be accessed and * Initialized at this point. */ public WebRequestCycle setupRequestAndResponse() { return setupRequestAndResponse(false); }
lastRenderedPage = generateLastRenderedPage(cycle); String redirectLocation = httpResponse.getRedirectLocation(); cycle = setupRequestAndResponse(false); servletRequest.setRequestToRedirectString(redirectLocation); cycle.request(); wicketRequest = application.newWebRequest(newHttpRequest); cycle = createRequestCycle(); cycle.request(); lastRenderedPage = generateLastRenderedPage(cycle); Session.set(getWicketSession()); if (getLastRenderedPage() instanceof ExceptionErrorPage) throw (RuntimeException)((ExceptionErrorPage)getLastRenderedPage()).getThrowable();
this.application = application; context = newServletContext(path); servletSession.setTemporary(initializeHttpSessionAsTemporary()); servletRequest = new MockHttpServletRequest(this.application, servletSession, context); servletResponse = new MockHttpServletResponse(servletRequest) createRequestCycle();
/** * Create and process the request cycle using the current request and response information. * * @param cycle */ public void processRequestCycle(WebRequestCycle cycle) { try { cycle.request(); if (cycle.wasHandled() == false) { cycle.setRequestTarget(new WebErrorCodeResponseTarget( HttpServletResponse.SC_NOT_FOUND)); } cycle.detach(); createRequestCycle(); } finally { cycle.getResponse().close(); } postProcessRequestCycle(cycle); }
wicketRequest = application.newWebRequest(servletRequest); wicketResponse = application.newWebResponse(servletResponse); WebRequestCycle requestCycle = createRequestCycle(); if (!initializeHttpSessionAsTemporary())
/** * Initialize a new WebRequestCycle and all its dependent objects * * @param <C> * * @param pageClass */ public <C extends Page> void processRequestCycle(final Class<C> pageClass) { processRequestCycle(pageClass, null); }
createRequestCycle(); IBookmarkablePageRequestTarget pageClassRequestTarget = (IBookmarkablePageRequestTarget)target; Class<? extends Page> pageClass = pageClassRequestTarget.getPageClass();
/** * Initialize a new WebRequestCycle and all its dependent objects * * @param component */ public void processRequestCycle(final Component component) { setupRequestAndResponse(); final WebRequestCycle cycle = createRequestCycle(); cycle.request(component); if (component instanceof Page) { lastRenderedPage = (Page)component; } postProcessRequestCycle(cycle); }
/** * Create and process the request cycle using the current request and response information. */ public void processRequestCycle() { processRequestCycle(createRequestCycle()); }