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


Java IRequestCycle类代码示例

本文整理汇总了Java中org.apache.wicket.request.IRequestCycle的典型用法代码示例。如果您正苦于以下问题:Java IRequestCycle类的具体用法?Java IRequestCycle怎么用?Java IRequestCycle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IRequestCycle类属于org.apache.wicket.request包,在下文中一共展示了IRequestCycle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: respond

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
/** {@inheritDoc} */
public void respond(final IRequestCycle requestCycle)
{
	String location = requestCycle.getUrlRenderer().renderRelativeUrl(Url.parse(getRedirectUrl()));
	
	WebResponse response = (WebResponse)requestCycle.getResponse();

	if (status == HttpServletResponse.SC_MOVED_TEMPORARILY)
	{
		response.sendRedirect(location);
	}
	else
	{
		response.setStatus(status);
		response.setHeader("Location", location);
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:18,代码来源:RedirectRequestHandler.java

示例2: onRequest

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public void onRequest() {
	final File file = initFile();	
	IResourceStream resourceStream = new FileResourceStream(new File(file));
	getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(
			new ResourceStreamRequestHandler(resourceStream) {

                   @Override
				public void respond(IRequestCycle requestCycle) {
                       try {
					    super.respond(requestCycle);
                       } finally {
                           if (removeFile) {
                               LOGGER.debug("Removing file '{}'.", new Object[]{file.getAbsolutePath()});
                               Files.remove(file);
                           }
                       }
				}
			}.setFileName(file.getName()).setContentDisposition(ContentDisposition.ATTACHMENT)
					.setCacheDuration(Duration.ONE_SECOND));
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:21,代码来源:AjaxDownloadBehaviorFromFile.java

示例3: onRequest

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public void onRequest() {
	
	IResourceStream resourceStream = getResourceStream();
	if (resourceStream == null) {
		return;		// We hope the error was already processed and will be shown.
	}

       ResourceStreamRequestHandler reqHandler = new ResourceStreamRequestHandler(resourceStream) {
           @Override
           public void respond(IRequestCycle requestCycle) {
               super.respond(requestCycle);
           }
       }.setContentDisposition(ContentDisposition.ATTACHMENT)
               .setCacheDuration(Duration.ONE_SECOND);
       if (StringUtils.isNotEmpty(getFileName())){
           reqHandler.setFileName(getFileName());
       }
	getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(reqHandler);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:AbstractAjaxDownloadBehavior.java

示例4: respond

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void respond(IRequestCycle requestCycle) {
    String script = ToastrHelper.generateJs(singularException, ToastrType.ERROR, false);

    WebResponse response = (WebResponse)requestCycle.getResponse();
    final String encoding = Application.get()
            .getRequestCycleSettings()
            .getResponseRequestEncoding();

    // Set content type based on markup type for page
    response.setContentType("text/xml; charset=" + encoding);

    // Make sure it is not cached by a client
    response.disableCaching();

    response.write("<?xml version=\"1.0\" encoding=\"");
    response.write(encoding);
    response.write("\"?>");
    response.write("<ajax-response>");
    response.write("<evaluate><![CDATA[" + script + "]]></evaluate>");
    response.write("</ajax-response>");

}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:24,代码来源:AjaxErrorRequestHandler.java

示例5: onRequest

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public void onRequest() {
	final File file = initFile();
	IResourceStream resourceStream = new FileResourceStream(new File(file));
	getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(
			new ResourceStreamRequestHandler(resourceStream) {

                   @Override
				public void respond(IRequestCycle requestCycle) {
                       try {
					    super.respond(requestCycle);
                       } finally {
                           if (removeFile) {
                               LOGGER.debug("Removing file '{}'.", new Object[]{file.getAbsolutePath()});
                               Files.remove(file);
                           }
                       }
				}
			}.setFileName(file.getName()).setContentDisposition(ContentDisposition.ATTACHMENT)
					.setCacheDuration(Duration.ONE_SECOND));
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:21,代码来源:AjaxDownloadBehaviorFromFile.java

示例6: onRequest

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public void onRequest() {

		IResourceStream resourceStream = getResourceStream();
		if (resourceStream == null) {
			return;		// We hope the error was already processed and will be shown.
		}

        ResourceStreamRequestHandler reqHandler = new ResourceStreamRequestHandler(resourceStream) {
            @Override
            public void respond(IRequestCycle requestCycle) {
                super.respond(requestCycle);
            }
        }.setContentDisposition(ContentDisposition.ATTACHMENT)
                .setCacheDuration(Duration.ONE_SECOND);
        if (StringUtils.isNotEmpty(getFileName())){
            reqHandler.setFileName(getFileName());
        }
		getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(reqHandler);
	}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:20,代码来源:AbstractAjaxDownloadBehavior.java

示例7: initMethods

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
private static Method[] initMethods() {
	HashSet<Method> aux = new HashSet<Method>(Arrays.asList(RequestTargetTester.class.getDeclaredMethods()));
	aux.remove(getMethodHelper("addListener", AjaxRequestTarget.IListener.class));
	aux.remove(getMethodHelper("respond", IRequestCycle.class));
	aux.remove(getMethodHelper("detach", IRequestCycle.class));
	return aux.toArray(new Method[aux.size()]);
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:8,代码来源:AbstractComponentTest.java

示例8: initLessCSS

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public static void initLessCSS(Class<? extends WebPage> appClass, IHeaderResponse response,
        IRequestCycle requestCycle, PathTupel... pathTupels) {

    for (int i = 0; pathTupels != null && i < pathTupels.length; i++) {
        PathTupel pathTupel = pathTupels[i];
        addStylesheetLessCSS(response, requestCycle, pathTupel);
    }

    if (isDevelopement()) {
        response.render(JavaScriptHeaderItem
                .forReference(new PackageResourceReference(LessCSSHelper.class, LESS_JS)));
    }
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:14,代码来源:LessCSSHelper.java

示例9: addStylesheetLessCSS

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public static void addStylesheetLessCSS(IHeaderResponse response, IRequestCycle requestCycle, PathTupel pathTupel) {
    if (isDevelopement()) {
        // dev mode
        response.render(StringHeaderItem.forString(MessageFormat.format(STYLESHEET_LESS,
                UrlUtils.rewriteToContextRelative(pathTupel.lessPath, requestCycle))));
    } else {
        //prod mode
        response.render(CssHeaderItem.forUrl(pathTupel.cssPath));
    }
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:11,代码来源:LessCSSHelper.java

示例10: onClick

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void onClick()
{
    final File file = getModelObject();
    if (file == null)
    {
        throw new IllegalStateException(getClass().getName() +
            " failed to retrieve a File object from model");
    }

    String fileName = encodedFileName();

    final IResourceStream resourceStream = new FileResourceStream(
        new org.apache.wicket.util.file.File(file)) {
        
        private static final long serialVersionUID = 1L;

        @Override
        public String getContentType() {
            return "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml";
        }
    };
    
    getRequestCycle().scheduleRequestHandlerAfterCurrent(
        new ResourceStreamRequestHandler(resourceStream)
        {
            @Override
            public void respond(IRequestCycle requestCycle)
            {
                super.respond(requestCycle);
                Files.remove(file);
            }
        }.setFileName(fileName)
            .setContentDisposition(ContentDisposition.ATTACHMENT));
}
 
开发者ID:isisaddons-legacy,项目名称:isis-wicket-excel,代码行数:36,代码来源:ExcelFileDownloadLink.java

示例11: detach

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
/** {@inheritDoc} */
public void detach(final IRequestCycle requestCycle)
{
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:5,代码来源:RedirectRequestHandler.java

示例12: detach

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void detach(IRequestCycle requestCycle) {
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:4,代码来源:AjaxErrorRequestHandler.java

示例13: respond

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void respond(IRequestCycle requestCycle) {
	inner.respond(requestCycle);
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:5,代码来源:AbstractComponentTest.java

示例14: detach

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void detach(IRequestCycle requestCycle) {
	inner.detach(requestCycle);
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:5,代码来源:AbstractComponentTest.java

示例15: respond

import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void respond(IRequestCycle requestCycle) {
	OrientDbWebApplication.get().onUnauthorizedInstantiation(component);
}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:5,代码来源:OrientDefaultExceptionsHandlingListener.java


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