public InputStream getInputStream() throws ResourceStreamNotFoundException { final ServletContext context = ((WebApplication)RequestCycle.get().getApplication()).getServletContext(); in = context.getResourceAsStream(url); if (in == null) { throw new ResourceStreamNotFoundException("The requested resource was not found: " + url); } return in; } }
public InputStream getInputStream() throws ResourceStreamNotFoundException { final ServletContext context = ((WebApplication)RequestCycle.get().getApplication()) .getServletContext(); in = context.getResourceAsStream(url); if (in == null) { throw new ResourceStreamNotFoundException("The requested resource was not found: " + url); } return in; } }
/** * Persister defaults are maintained centrally by the Application. * * @return Persister default value */ private CookieValuePersisterSettings getSettings() { return RequestCycle.get() .getApplication() .getSecuritySettings() .getCookieValuePersisterSettings(); }
/** * Prepare the request cycle. */ private void prepare() { try { getApplication().getSessionStore().onBeginRequest(getRequest()); } catch (RuntimeException e) { log.error("Exception occurred during onEndRequest of the SessionStore", e); } // Event callback onBeginRequest(); }
/** * Prepare the request cycle. */ private void prepare() { try { getApplication().getSessionStore().onBeginRequest(getRequest()); } catch (RuntimeException e) { log.error("Exception occurred during onBeginRequest of the SessionStore", e); } // Event callback onBeginRequest(); }
/** * Based on the Session's locale determine the associated character encoding. * * @param cycle * @return Char set to use for response. */ public final static String getEncoding(final RequestCycle cycle) { if (charSetMap == null) { initialize((WebApplication)cycle.getApplication()); } return charSetMap.getCharSet(cycle.getSession().getLocale()); } }
final ServletContext context = ((WebApplication)requestCycle.getApplication()).getServletContext();
final ServletContext context = ((WebApplication)requestCycle.getApplication()).getServletContext();
/** * Constructs a new instance of a page given its class name * * @param pageClass * class name of the page to be created * @param requestCycle * request cycle * @return new instance of page */ protected Page newPage(final Class pageClass, final RequestCycle requestCycle) { // Construct a new instance using the default page factory IPageFactory pageFactory = requestCycle.getApplication().getSessionSettings() .getPageFactory(); if (pageParameters == null || pageParameters.size() == 0) { return pageFactory.newPage(pageClass); } else { // Add bookmarkable params in for WICKET-400. requestCycle.getRequest().getParameterMap().putAll(pageParameters); return pageFactory.newPage(pageClass, pageParameters); } }
/** * Common functionality to be called by processEvents() * * @param requestCycle * The request cycle */ protected void onProcessEvents(final RequestCycle requestCycle) { getPage().startComponentRender(getTarget()); final Application application = requestCycle.getApplication(); // and see if we have to redirect the render part by default IRequestCycleSettings.RenderStrategy strategy = application.getRequestCycleSettings() .getRenderStrategy(); boolean issueRedirect = (strategy == IRequestCycleSettings.REDIRECT_TO_RENDER || strategy == IRequestCycleSettings.REDIRECT_TO_BUFFER); requestCycle.setRedirect(issueRedirect); } }
/** * Common functionality to be called by processEvents() * * @param requestCycle * The request cycle */ protected void onProcessEvents(final RequestCycle requestCycle) { getPage().startComponentRender(getTarget()); final Application application = requestCycle.getApplication(); // and see if we have to redirect the render part by default IRequestCycleSettings.RenderStrategy strategy = application.getRequestCycleSettings() .getRenderStrategy(); boolean issueRedirect = (strategy == IRequestCycleSettings.REDIRECT_TO_RENDER || strategy == IRequestCycleSettings.REDIRECT_TO_BUFFER); requestCycle.setRedirect(issueRedirect); } }
IRequestLogger requestLogger = getApplication().getRequestLogger(); if (requestLogger != null) getApplication().getSessionStore().onEndRequest(getRequest());
IRequestLogger requestLogger = getApplication().getRequestLogger(); if (requestLogger != null) getApplication().getSessionStore().onEndRequest(getRequest());
IPageFactory pageFactory = requestCycle.getApplication() .getSessionSettings() .getPageFactory();
requestParameters.setResourceKey(resourceReference.getSharedResourceKey()); String name = resourceReference.getName(); if (getApplication().getResourceSettings().getAddLastModifiedTimeToResourceReferenceUrl() && !Strings.isEmpty(name) && !name.endsWith("/")) // test for / because it could be a
Application application = requestCycle.getApplication(); SharedResources sharedResources = application.getSharedResources(); final String resourceKey = getRequestParameters().getResourceKey();
Application application = requestCycle.getApplication(); SharedResources sharedResources = application.getSharedResources(); final String resourceKey = getRequestParameters().getResourceKey();
/** * Returns a URL that references a shared resource through the provided resource reference. * * @param resourceReference * The resource reference where a url must be generated for. * @param parameters * The parameters to pass to the resource. * @return The url for the shared resource */ public final CharSequence urlFor(final ResourceReference resourceReference, ValueMap parameters) { RequestParameters requestParameters = new RequestParameters(); requestParameters.setResourceKey(resourceReference.getSharedResourceKey()); if (getApplication().getResourceSettings().getAddLastModifiedTimeToResourceReferenceUrl() && !Strings.isEmpty(resourceReference.getName())) { Time time = resourceReference.lastModifiedTime(); if (time != null) { if (parameters == null) { parameters = new ValueMap(); parameters.put("wicket:lm", new Long(time.getMilliseconds())); } } } requestParameters.setParameters(parameters); return encodeUrlFor(new SharedResourceRequestTarget(requestParameters)); }
final Application application = cycle.getApplication(); final Response response = cycle.getResponse();
final Application application = cycle.getApplication(); final Response response = cycle.getResponse();