本文整理汇总了Java中org.apache.wicket.request.flow.RedirectToUrlException类的典型用法代码示例。如果您正苦于以下问题:Java RedirectToUrlException类的具体用法?Java RedirectToUrlException怎么用?Java RedirectToUrlException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RedirectToUrlException类属于org.apache.wicket.request.flow包,在下文中一共展示了RedirectToUrlException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractFormPage
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
public AbstractFormPage(@Nullable ActionContext context, @Nullable Class<? extends SType<?>> formType) {
if (context == null) {
String url = singularServerMetadata.getServerBaseUrl();
getLogger().info(" Redirecting to {}", url);
throw new RedirectToUrlException(url);
}
this.config = new FormPageExecutionContext(Objects.requireNonNull(context), getTypeName(formType), getFlowResolver(context), getRequirementSender(context));
this.formKeyModel = $m.ofValue();
this.parentRequirementFormKeyModel = $m.ofValue();
this.inheritParentFormData = $m.ofValue();
this.typeName = config.getFormName();
this.singularFormPanel = new SingularFormPanel("singular-panel");
onBuildSingularFormPanel(singularFormPanel);
context.getInheritParentFormData().ifPresent(inheritParentFormData::setObject);
if (this.config.getFormName() == null) {
throw new SingularServerException("Tipo do formulário da página nao foi definido");
}
}
示例2: ApplicationAccessTemplate
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
public ApplicationAccessTemplate(PageParameters parameters) {
super(parameters);
if (Boolean.TRUE.equals(propertyService.get(MAINTENANCE)) && !authenticationService.hasAdminRole()
&& hasMaintenanceRestriction()) {
throw new RedirectToUrlException(propertyService.get(MAINTENANCE_URL));
}
add(new EnvironmentPanel("environment"));
add(new AnimatedGlobalFeedbackPanel("feedback"));
add(new TransparentWebMarkupContainer("htmlRootElement")
.add(AttributeAppender.append("lang", BasicApplicationSession.get().getLocale().getLanguage())));
addHeadPageTitlePrependedElement(new BreadCrumbElement(new ResourceModel("common.rootPageTitle")));
add(createHeadPageTitle("headPageTitle"));
add(new CoreLabel("title", getTitleModel()));
}
示例3: startTimer
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
private void startTimer(IPartialPageRequestHandler handler) {
label.add(new OmRedirectTimerBehavior(DELAY, labelId) {
private static final long serialVersionUID = 1L;
@Override
protected void onFinish(AjaxRequestTarget target) {
if (Strings.isEmpty(url)) {
throw new RestartResponseException(Application.get().getHomePage());
} else {
throw new RedirectToUrlException(url);
}
}
});
if (handler != null) {
handler.add(label);
}
}
示例4: additionalMenuPerformed
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
private void additionalMenuPerformed(MainMenuItem menu) {
LOGGER.trace("additionalMenuPerformed: {}", menu);
if (menu.getPageClass() != null) {
setResponsePage(menu.getPageClass());
} else {
throw new RedirectToUrlException(((AdditionalMenuItem)menu).getTargetUrl());
}
}
示例5: createOptionsDropdown
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
protected Component createOptionsDropdown(final ResourceInfoModel resourceInfoModel) {
final ArrayList options = Lists.newArrayList(
new BootstrapDropdown.DropdownMenuItem("Process with Language Resource Switchboard", "glyphicon glyphicon-open-file") {
@Override
protected Link getLink(String id) {
return new Link(id) {
@Override
public void onClick() {
throw new RedirectToUrlException(getLanguageSwitchboardUrl(resourceInfoModel.getObject()));
}
};
}
}
);
return new BootstrapDropdown("dropdown", new ListModel(options)) {
@Override
protected Serializable getButtonClass() {
return null; //render as link, not button
}
@Override
protected Serializable getButtonIconClass() {
return "glyphicon glyphicon-option-horizontal";
}
@Override
protected boolean showCaret() {
return false;
}
};
}
示例6: buildContent
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
protected void buildContent() {
queue(new Label("nome", $m.ofValue(SingularSession.get().getName())));
WebMarkupContainer avatar = new WebMarkupContainer("codrh");
Optional<String> avatarSrc = Optional.ofNullable(null);
avatarSrc.ifPresent(src -> avatar.add($b.attr("src", src)));
queue(avatar);
avatar.setVisible(avatarSrc.isPresent());
SecurityAuthPathsFactory securityAuthPathsFactory = new SecurityAuthPathsFactory();
SecurityAuthPaths securityAuthPaths = securityAuthPathsFactory.get();
Link logout = new Link("logout") {
@Override
public void onClick() {
throw new RedirectToUrlException(securityAuthPaths.getLogoutPath(RequestCycle.get()));
}
};
queue(logout);
// final WebMarkupContainer opcoesVisuais = new WebMarkupContainer("opcoes-visuais");
// opcoesVisuais.setRenderBodyOnly(true);
// opcoesVisuais.setVisible(option.options().size() > 1);
// opcoesVisuais.queue(buildSkinOptions());
// queue(opcoesVisuais);
}
示例7: resetLogin
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
private void resetLogin(RequestCycle cycle) {
SecurityAuthPathsFactory securityAuthPathsFactory = new SecurityAuthPathsFactory();
SecurityAuthPaths securityAuthPaths = securityAuthPathsFactory.get();
String redirectURL = securityAuthPaths.getLogoutPath(cycle);
getLogger().info("Redirecting to {}", redirectURL);
throw new RedirectToUrlException(redirectURL);
}
示例8: exit
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
public void exit(IPartialPageRequestHandler handler) {
exitRoom(room.getClient());
if (WebSession.getRights().contains(User.Right.Dashboard)) {
room.getMainPanel().updateContents(ROOMS_PUBLIC, handler);
} else {
String url = getBean(ConfigurationDao.class).getString(CONFIG_REDIRECT_URL_FOR_EXTERNAL, "");
throw new RedirectToUrlException(Strings.isEmpty(url) ? getBaseUrl() : url);
}
}
示例9: onSignInSucceeded
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
@Hidden
public void onSignInSucceeded() {
// If login has been called because the user was not yet logged in, then continue to the
// original destination, otherwise to the Home page
final ISavedRequest savedRequest = Roles.getAuthenticationService().getSavedRequest();
//saved request might be null from spring-security, since redirect to login might have been handled by wicket instead
if (savedRequest != null && savedRequest.getRedirectUrl() != null) {
throw new RedirectToUrlException(savedRequest.getRedirectUrl());
}
component.continueToOriginalDestination();
throw new RestartResponseException(ABaseWebApplication.get().getHomePage());
}
示例10: newRedirectToUrlException
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
@Override
public RedirectToUrlException newRedirectToUrlException() throws LinkInvalidTargetRuntimeException,
LinkParameterValidationRuntimeException, LinkParameterInjectionRuntimeException {
throw invalidException();
}
示例11: newRedirectToUrlException
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
@Override
public RedirectToUrlException newRedirectToUrlException() throws LinkParameterValidationRuntimeException {
return new RedirectToUrlException(fullUrl());
}
示例12: newRedirectToUrlException
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
@Override
public RedirectToUrlException newRedirectToUrlException() throws LinkInvalidTargetRuntimeException {
return new RedirectToUrlException(fullUrl());
}
示例13: newRedirectToUrlException
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
@Override
public RedirectToUrlException newRedirectToUrlException() throws LinkInvalidTargetRuntimeException,
LinkParameterValidationRuntimeException, LinkParameterInjectionRuntimeException {
return delegate().newRedirectToUrlException();
}
示例14: showAuth
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
public static void showAuth(final OAuthServer s) {
String authUrl = prepareUrlParams(s.getRequestKeyUrl(), s.getClientId(), getRedirectUri(s), null, null, null);
log.debug("redirectUrl={}", authUrl);
throw new RedirectToUrlException(authUrl);
}
示例15: redirectToNewPollPage
import org.apache.wicket.request.flow.RedirectToUrlException; //导入依赖的package包/类
public static void redirectToNewPollPage(final PageParameters parameters) {
throw new RedirectToUrlException(RequestCycle.get().urlFor(NewPollPage.class, parameters).toString());
}