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


Java NonResettingRestartException类代码示例

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


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

示例1: setDefaultResponsePageIfNecessary

import org.apache.wicket.NonResettingRestartException; //导入依赖的package包/类
private void setDefaultResponsePageIfNecessary()
{
    // This does not work because it was Spring Security that intercepted the access, not
    // Wicket continueToOriginalDestination();

    String redirectUrl = getRedirectUrl();
    
    if (redirectUrl == null || redirectUrl.contains(".IBehaviorListener.")
            || redirectUrl.contains("-logoutPanel-")) {
        log.debug("Redirecting to welcome page");
        setResponsePage(getApplication().getHomePage());
    }
    else {
        log.debug("Redirecting to saved URL: [{}]", redirectUrl);
        if (isNotBlank(form.urlfragment) && form.urlfragment.startsWith("!")) {
            Url url = Url.parse("http://dummy?" + form.urlfragment.substring(1));
            UrlRequestParametersAdapter adapter = new UrlRequestParametersAdapter(url);
            LinkedHashMap<String, StringValue> params = new LinkedHashMap<>();
            for (String name : adapter.getParameterNames()) {
                params.put(name, adapter.getParameterValue(name));
            }
            Session.get().setMetaData(SessionMetaData.LOGIN_URL_FRAGMENT_PARAMS, params);
        }
        throw new NonResettingRestartException(redirectUrl);
    }
}
 
开发者ID:webanno,项目名称:webanno,代码行数:27,代码来源:LoginPage.java

示例2: loginButtonOnSubmit

import org.apache.wicket.NonResettingRestartException; //导入依赖的package包/类
private void loginButtonOnSubmit(Button button) {
    boolean valid = Session.get().signIn(this.login, this.password);
    if (valid) {
        if (this.originalUrl != null) {
            String url = RequestCycle.get().getUrlRenderer().renderUrl(this.originalUrl);
            throw new NonResettingRestartException(url);
        } else {
            setResponsePage(getApplication().getHomePage());
        }
    } else {
        this.loginField.error(new ValidationError().addKey("incorrect"));
        this.passwordField.error(new ValidationError().addKey("incorrect"));
    }
}
 
开发者ID:PkayJava,项目名称:MBaaS,代码行数:15,代码来源:LoginPage.java

示例3: export

import org.apache.wicket.NonResettingRestartException; //导入依赖的package包/类
private FileResourceStream export()
{
    File downloadFile = null;
    String username = state.getObject().getMode()
            .equals(Mode.AUTOMATION)
            && preferences.getObject().documentType
                    .equals(SELECTEXPORT.AUTOMATED.toString()) ? "CORRECTION_USER"
                            : SecurityContextHolder.getContext().getAuthentication()
                                    .getName();
    try {
        downloadFile = importExportService.exportAnnotationDocument(
                state.getObject().getDocument(), username,
                importExportService.getWritableFormats()
                        .get(importExportService
                                .getWritableFormatId(preferences.getObject().format)),
                state.getObject().getDocument().getName(),
                state.getObject().getMode());
    }
    catch (Exception e) {
        LOG.error("Export failed", e);
        error("Export failed:" + ExceptionUtils.getRootCauseMessage(e));
        // This will cause the open dialog to pop up again, but at least
        // the error feedback message will be visible. With the 
        // RestartResponseException the feedback message only flashes.
        throw new NonResettingRestartException(getPage().getPageClass());
    }
        
    return new FileResourceStream(downloadFile);
}
 
开发者ID:webanno,项目名称:webanno,代码行数:30,代码来源:ExportDocumentDialogContent.java

示例4: HomePage

import org.apache.wicket.NonResettingRestartException; //导入依赖的package包/类
public HomePage(final PageParameters parameters) {
    super(parameters);

    StringBuilder redirectUrl = new StringBuilder("/app/");
    if (!parameters.get("errorMessage").isNull()) {
        redirectUrl.append("#!self?errorMessage=");
        appendMessage(redirectUrl, parameters.get("errorMessage").toString());
    } else if (!parameters.get("successMessage").isNull()) {
        redirectUrl.append("#!self?successMessage=");
        appendMessage(redirectUrl, parameters.get("successMessage").toString());
    }
    throw new NonResettingRestartException(redirectUrl.toString());
}
 
开发者ID:apache,项目名称:syncope,代码行数:14,代码来源:HomePage.java


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