当前位置: 首页>>代码示例>>Java>>正文


Java WebRequestCycle类代码示例

本文整理汇总了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);
}
 
开发者ID:mpobjects,项目名称:xrebelhub-wicket-endpoints,代码行数:10,代码来源:XrhRequestLogger.java

示例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();
	}
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:22,代码来源:GitBlitWebSession.java

示例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;
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:13,代码来源:ConstellioApplication.java

示例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);
}
  }
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:31,代码来源:SmbServletPage.java

示例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;
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:15,代码来源:LoginPage.java

示例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);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:6,代码来源:HomePage.java


注:本文中的org.apache.wicket.protocol.http.WebRequestCycle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。