|
42 | 42 | import java.util.Set; |
43 | 43 | import java.util.logging.Logger; |
44 | 44 |
|
45 | | -import com.sun.faces.util.FacesLogger; |
46 | | -import com.sun.faces.util.MessageUtils; |
47 | | -import com.sun.faces.util.Util; |
48 | | - |
49 | 45 | import jakarta.el.MethodExpression; |
50 | 46 | import jakarta.faces.FacesException; |
51 | 47 | import jakarta.faces.application.ProtectedViewException; |
|
70 | 66 | import jakarta.faces.view.ViewDeclarationLanguage; |
71 | 67 | import jakarta.faces.view.ViewMetadata; |
72 | 68 |
|
| 69 | +import com.sun.faces.util.FacesLogger; |
| 70 | +import com.sun.faces.util.MessageUtils; |
| 71 | +import com.sun.faces.util.Util; |
| 72 | + |
73 | 73 | /** |
74 | 74 | * <B>Lifetime And Scope</B> |
75 | 75 | * <P> |
|
78 | 78 | */ |
79 | 79 | public class RestoreViewPhase extends Phase { |
80 | 80 |
|
81 | | - private static final String WEBAPP_ERROR_PAGE_MARKER = "jakarta.servlet.error.message"; |
| 81 | + private static final String WEBAPP_ERROR_MESSAGE_MARKER = "jakarta.servlet.error.message"; // RequestDispatcher.ERROR_MESSAGE |
| 82 | + private static final String WEBAPP_ERROR_EXCEPTION_MARKER = "jakarta.servlet.error.exception"; // RequestDispatcher.ERROR_EXCEPTION |
| 83 | + |
82 | 84 | private static final Logger LOGGER = FacesLogger.LIFECYCLE.getLogger(); |
83 | 85 |
|
84 | 86 | private static final Set<VisitHint> SKIP_ITERATION_HINT = EnumSet.of(SKIP_ITERATION); |
@@ -430,11 +432,12 @@ private void notifyAfter(FacesContext context, Lifecycle lifecycle) { |
430 | 432 | * Use this method to determine if the current request is an error page to avoid the above condition. |
431 | 433 | * |
432 | 434 | * @param context the FacesContext for the current request |
433 | | - * @return <code>true</code> if <code>WEBAPP_ERROR_PAGE_MARKER</code> is found in the request, otherwise return |
434 | | - * <code>false</code> |
| 435 | + * @return <code>true</code> if <code>WEBAPP_ERROR_MESSAGE_MARKER</code> or <code>WEBAPP_ERROR_EXCEPTION_MARKER</code> |
| 436 | + * is found in the request, otherwise return <code>false</code> |
435 | 437 | */ |
436 | 438 | private static boolean isErrorPage(FacesContext context) { |
437 | | - return context.getExternalContext().getRequestMap().get(WEBAPP_ERROR_PAGE_MARKER) != null; |
| 439 | + Map<String, Object> requestMap = context.getExternalContext().getRequestMap(); |
| 440 | + return requestMap.get(WEBAPP_ERROR_MESSAGE_MARKER) != null || requestMap.get(WEBAPP_ERROR_EXCEPTION_MARKER) != null; |
438 | 441 | } |
439 | 442 |
|
440 | 443 | } |
0 commit comments