org.apache.wicket.request.cycle.RequestCycleContext Java Examples

The following examples show how to use org.apache.wicket.request.cycle.RequestCycleContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ApplicationHelper.java    From openmeetings with Apache License 2.0 5 votes vote down vote up
public static IApplication ensureApplication(Long langId) {
	IApplication a = ensureApplication();
	if (ThreadContext.getRequestCycle() == null) {
		ServletWebRequest req = new ServletWebRequest(new MockHttpServletRequest((Application)a, new MockHttpSession(a.getServletContext()), a.getServletContext()), "");
		RequestCycleContext rctx = new RequestCycleContext(req, new MockWebResponse(), a.getRootRequestMapper(), a.getExceptionMapperProvider().get());
		ThreadContext.setRequestCycle(new RequestCycle(rctx));
	}
	if (ThreadContext.getSession() == null) {
		WebSession s = WebSession.get();
		if (langId > 0) {
			((IWebSession)s).setLanguage(langId);
		}
	}
	return a;
}
 
Example #2
Source File: StorefrontApplication.java    From yes-cart with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public RequestCycle apply(final RequestCycleContext context) {
    return new RequestCycle(context);
}