本文整理汇总了Java中org.apache.wicket.protocol.http.WebRequestCycle类的典型用法代码示例。如果您正苦于以下问题:Java WebRequestCycle类的具体用法?Java WebRequestCycle怎么用?Java WebRequestCycle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebRequestCycle类属于org.apache.wicket.protocol.http包,在下文中一共展示了WebRequestCycle类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: defineEntryPoint
import org.apache.wicket.protocol.http.WebRequestCycle; //导入依赖的package包/类
private void defineEntryPoint(IRequestTarget aTarget) {
RequestCycle requestCycle = RequestCycle.get();
if (!(requestCycle instanceof WebRequestCycle)) {
return;
}
String entryPoint = formatEntryPoint(aTarget);
WebResponse response = ((WebRequestCycle) requestCycle).getWebResponse();
response.setHeader(ENTRY_POINT_HEADER, entryPoint);
}
示例2: cacheRequest
import org.apache.wicket.protocol.http.WebRequestCycle; //导入依赖的package包/类
/**
* Cache the requested protected resource pending successful authentication.
*
* @param pageClass
*/
public void cacheRequest(Class<? extends Page> pageClass) {
// build absolute url with correctly encoded parameters?!
Request req = WebRequestCycle.get().getRequest();
Map<String, ?> params = req.getRequestParameters().getParameters();
PageParameters pageParams = new PageParameters(params);
String relativeUrl = WebRequestCycle.get().urlFor(pageClass, pageParams).toString();
requestUrl = RequestUtils.toAbsolutePath(relativeUrl);
if (isTemporary())
{
// we must bind the temporary session into the session store
// so that we can re-use this session for reporting an error message
// on the redirected page and continuing the request after
// authentication.
bind();
}
}
示例3: getExternalParams
import org.apache.wicket.protocol.http.WebRequestCycle; //导入依赖的package包/类
private static String getExternalParams(CharSequence encoded) {
String externalParams;
WebRequestCycle webRequestCycle = (WebRequestCycle) RequestCycle.get();
HttpServletRequest request = webRequestCycle.getWebRequest().getHttpServletRequest();
GlobalExtraParamsPlugin globalExtraParamsPlugin = PluginFactory.getPlugin(GlobalExtraParamsPlugin.class);
if (globalExtraParamsPlugin != null) {
externalParams = globalExtraParamsPlugin.getExtraParams(encoded, request);
} else {
externalParams = "";
}
return externalParams;
}
示例4: SmbServletPage
import org.apache.wicket.protocol.http.WebRequestCycle; //导入依赖的package包/类
public SmbServletPage(PageParameters parameters) throws SmbException {
super(parameters);
String recordID = parameters.getString(RECORD_ID);
if (StringUtils.isBlank(recordID)) {
throw new WicketRuntimeException(RECORD_ID + " parameter is required");
}
String collectionName = parameters.getString(COLLECTION);
if (StringUtils.isBlank(collectionName)) {
throw new WicketRuntimeException(COLLECTION + " parameter is required");
}
SmbFile downloadedSmbFile = getSmbFile(Long.valueOf(recordID), collectionName);
WebRequestCycle requestCycle = (WebRequestCycle) RequestCycle.get();
HttpServletResponse response = requestCycle.getWebResponse().getHttpServletResponse();
response.setContentType("application/octet-stream" );
response.setContentLength( (int) downloadedSmbFile .length() );
response.setHeader( "Content-Disposition", "attachment; filename=\"" + downloadedSmbFile.getName() + "\"" );
try{
InputStream is = new BufferedInputStream(downloadedSmbFile.getInputStream());
IOUtils.copy(is, response.getOutputStream());
IOUtils.closeQuietly(is);
} catch(IOException e){
throw new RuntimeException(e);
}
}
示例5: handleUsernamePasswordParameters
import org.apache.wicket.protocol.http.WebRequestCycle; //导入依赖的package包/类
private boolean handleUsernamePasswordParameters() {
String iframeLoginUsername = RequestCycle.get().getRequest().getParameter("iframe_username");
String iframeLoginPassword = RequestCycle.get().getRequest().getParameter("iframe_password");
if (iframeLoginUsername != null && iframeLoginPassword != null) {
boolean valid = ConstellioSession.get().signIn(iframeLoginUsername, iframeLoginPassword);
if (valid) {
ConstellioSession.get().signIn(iframeLoginUsername, iframeLoginPassword);
WebRequestCycle.get().setResponsePage(SearchFormPage.class);
return true;
}
}
return false;
}
示例6: getThemeDislay
import org.apache.wicket.protocol.http.WebRequestCycle; //导入依赖的package包/类
private ThemeDisplay getThemeDislay() {
HttpServletRequest req = ((ServletWebRequest) WebRequestCycle.get()
.getRequest()).getHttpServletRequest();
return (ThemeDisplay) req.getAttribute(WebKeys.THEME_DISPLAY);
}