All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jakarta.faces.application.ViewExpiredException Maven / Gradle / Ivy

There is a newer version: 11.0.0-M4
Show newest version
/*
 * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0, which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the
 * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
 * version 2 with the GNU Classpath Exception, which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
 */

package jakarta.faces.application;

import jakarta.faces.FacesException;

/**
 * 

* Implementations must throw this {@link FacesException} when attempting to restore the view * {@link StateManager#restoreView(jakarta.faces.context.FacesContext, String, String)} results in failure on postback. *

* * @since 1.2 */ public class ViewExpiredException extends FacesException { private static final long serialVersionUID = 5175808310270035833L; // ----------------------------------------------------- Instance Variables /** *

* The view identifier of the view that could not be restored. *

*/ private String viewId; // ----------------------------------------------------------- Constructors /** *

* Construct a new exception with no detail message or root cause. *

*/ public ViewExpiredException() { super(); } /** *

* Construct a new exception with the specified view identifier. *

* * @param viewId The view identifier for this exception */ public ViewExpiredException(String viewId) { this.viewId = viewId; } /** *

* Construct a new exception with the specified detail message and no root cause. *

* * @param message The detail message for this exception * @param viewId The view identifier for this exception */ public ViewExpiredException(String message, String viewId) { super(message); this.viewId = viewId; } /** *

* Construct a new exception with the specified root cause. The detail message will be set to * (cause == null ? null : * cause.toString() * * @param cause The root cause for this exception * @param viewId The view identifier for this exception */ public ViewExpiredException(Throwable cause, String viewId) { super(cause); this.viewId = viewId; } /** *

* Construct a new exception with the specified detail message and root cause. *

* * @param message The detail message for this exception * @param cause The root cause for this exception * @param viewId The view identifier for this exception */ public ViewExpiredException(String message, Throwable cause, String viewId) { super(message, cause); this.viewId = viewId; } // --------------------------------------------------------- Public Methods /** *

* Return the view identifier of this exception, or null if the view identifier is nonexistent or unknown. *

* * @return the view id, or null. */ public String getViewId() { return viewId; } /** *

* Return the message for this exception prepended with the view identifier if the view identifier is not * null, otherwise, return the message. *

* * @return the message. */ @Override public String getMessage() { if (viewId != null) { return "viewId:" + viewId + " - " + super.getMessage(); } return super.getMessage(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy