/** * Throw an exception that will forward to the page with an error message. * @param uri The URI to forward to * @param cause The cause of this problem * @return The exception to throw */ public static WebApplicationException forward(@NotNull final URI uri, @NotNull final Exception cause) { return FlashInset.forward(uri, cause.getMessage(), Level.SEVERE); }
final String[] parts = header.split("\\s+"); if (!"Basic".equals(parts[0])) { throw FlashInset.forward( this.resource.uriInfo().getBaseUri(), String.format( final String[] tokens = StringUtils.splitPreserveAllTokens(body, ':'); if (tokens.length != 2) { throw FlashInset.forward( this.resource.uriInfo().getBaseUri(), String.format(
/** * Get current user. * @return User */ protected final User user() { final Identity identity = this.auth().identity(); if (identity.equals(Identity.ANONYMOUS)) { throw FlashInset.forward( this.uriInfo().getBaseUriBuilder().clone() .path(IndexRs.class) .build(), "please login first", Level.SEVERE ); } return this.base().user(identity.urn()); }